Trying to redo some code in Vyper & IERC20 use in Solidity is simple, but remaking the same functionality seems hard in Vyper. Which is stopping the whole thing from working.
function depositERC20(
IERC20 token, <---- What does this actually do?
uint256 amount,
address receiverAddress,
uint256 targetChainId
) external payable;
Trying to use self, or even remaking the IER20 doesn't seem to work. Calling IERC20 seems to return the contract address?
@external
def depositERC20(token: self, amount: uint256, receiverAddress: address, targetChainId: uint256): payable
I just need to work out what does IERC20 do in this instance & how do I work out how to send the same thing in Vyper.
Also, please make Vyper interfaces
interface IERC20:
@external
def totalSupply() -> uint256: view
@external
def balanceOf(account: address) -> uint256: view
@external
def transfer(to: address, amount: uint256) -> bool: payable
@external
def allowance(owner: address, spender: address) -> uint256: view
@external
def approve(spender: address, amount: uint256) -> bool: view
@external
def transferFrom(transferFrom: address, to: address, amount: uint256) -> bool: payable
I tried making IERC20 in Vyper & then doing this, but didn't work.
@external
def depositERC20(token: IERC20, amount: uint256, receiverAddress: address, targetChainId: uint256): payable