Hi, just a quick (and maybe stupid) question:
How should an interface file be structured?
Eg I have an interface.vy and a contract.vy in the same folder. Contract.vy should implement interface.vy.
in my interface.vy, should there by just the public functions and events? only functions? or should there be an interface declaration... I am really confused right now...Bonus question: where should the
implements: interface
be placed in contract.vy? at the top or in the interface section?
implements: is to be used at the top; so it's always clear.
Hi newbie here, I'm just testing out calling external interfaces but I can't seem to get swapExactETHForTokens
working, probably doing something very silly. Here's part of my code:
interface Uniswap:
def swapExactETHForTokens(amountOutMin: uint256, path: address[2], to: address, deadline: uint256 ): payable
@external
@payable
def swapExactETHForTokensCall():
assert msg.sender == self.owner, "sender is not the owner"
self.path[0] = self.weth
self.path[1] = self.dai
min_tokens: uint256 = 1
deadline: uint256 = block.timestamp + 300
Uniswap(self.uniRouter).swapExactETHForTokens(min_tokens, self.path, msg.sender, deadline, value=msg.value)
My tx is getting reverted and the trace fails after the CALL opcode
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
@gunnertwin the difference is Uniswap is using a dynamically sized array, whereas Vyper only currently supports static sized arrays. one of the things we are targeting to add in 0.3.0
Hello @gunnertwin what is the expected release date for 0.3.0 ?
@aallamaa I think the docs just need to be regenerated, the docs were fixed in vyperlang/vyper#2268
Thanks Jake
Hi All, I am new to vyper and need help to find out the documentation to develop , deploy and interact with ERC721 token implementation with web3
I'd take a look at this. There are lots of comments in the vyper script, hope that helps you deploying the token.
https://github.com/vyperlang/vyper/blob/master/examples/tokens/ERC721.vy
TBH, the best environment that I can suggest is to use eth-brownie.
https://eth-brownie.readthedocs.io/en/stable
Brownie will manage solidity/vyper contracts