-
-
Save benadamsky/0a28fe9ee6130b11a60febd3776d3754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
const amount = ethers.utils.parseUnits(inputText, contract.decimals) | |
const erc20Abi = [ | |
{ | |
constant: false, | |
inputs: [ | |
{ | |
name: 'spender', | |
type: 'address', | |
}, | |
{ | |
name: 'amount', | |
type: 'uint256', | |
}, | |
], | |
name: 'approve', | |
outputs: [ | |
{ | |
name: '', | |
type: 'bool', | |
}, | |
], | |
payable: false, | |
stateMutability: 'nonpayable', | |
type: 'function', | |
}, | |
] | |
return c.contract({ | |
abi: erc20Abi, | |
chainId: 'eip155:8453', // hardcoded base for now | |
functionName: 'approve', | |
args: [surveyBountyContract.address, amount], | |
to: contract.address, | |
}) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment