Skip to content

Commit b83ae19

Browse files
committed
hardcoding erc20 token abi based on Oren's feedback
1 parent 5c5c700 commit b83ae19

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/arc.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
Web3Client,
4343
Web3Provider
4444
} from './index'
45-
import { LATEST_ARC_VERSION } from './settings'
4645

4746
const abis = require('./abis/abis.json')
4847

@@ -631,9 +630,22 @@ export class Arc extends GraphNodeObserver {
631630
}
632631

633632
public approveTokens(tokenAddress: Address, spender: Address, amount: BN) {
634-
const erc20Abi = this.getABI({ abiName: 'ERC20Mock', version: LATEST_ARC_VERSION })
635633
const signer = (this.web3 as JsonRpcProvider).getSigner(this.defaultAccount as any)
636-
const tokenContract = new Contract(tokenAddress, erc20Abi, signer)
634+
const abi = [
635+
{
636+
constant: false,
637+
inputs: [
638+
{ name: '_spender', type: 'address' },
639+
{ name: '_value', type: 'uint256' }
640+
],
641+
name: 'approve',
642+
outputs: [{ name: '', type: 'bool' }],
643+
payable: false,
644+
stateMutability: 'nonpayable',
645+
type: 'function'
646+
}
647+
]
648+
const tokenContract = new Contract(tokenAddress, abi, signer)
637649

638650
return this.sendTransaction({
639651
contract: tokenContract,

test/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,4 @@ export function getContractAddressesFromMigration(environment: 'private' | 'rink
286286
}
287287
}
288288
return contracts
289-
}
289+
}

0 commit comments

Comments
 (0)