Calling interface functions from truffle console #5514
Unanswered
pclaesen
asked this question in
General Q&A
Replies: 1 comment
-
Hey @pclaesen please take a look at the Truffle console commands here: https://trufflesuite.com/docs/truffle/reference/truffle-commands/ You will be able to interact and call functions from your contract when you enter Truffle Develop mode. Let me know if this helps. Kind regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I forked mainnet, using truffle console now to test.
For my contract, I need to approve an ERC20 token, before I can use
transferFrom()
, and I'd also like to use thebalanceOf(address)
andallowance
functionHere is some code:
interface IErc20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool success); function allowance(address owner, address spender) external view returns (uint256); function balanceOf(address) external returns (uint256); }
Does anyone know how I can call these interface functions?
Beta Was this translation helpful? Give feedback.
All reactions