Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jacques Wagener
    @jacqueswww
    The whole idea of Vyper is too keep things straight forward; so I like to think the learning curve is actually quite good.

    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.

    I believe the compiler also enforces this
    @Thrasymachus01 best is to implement this yourself as a function (sqrtu) it do able in vyper for sure. As always with math you have to do thorough testing - hypothesis is great for this.
    gunnertwin
    @gunnertwin

    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

    Here's the solidity function
        function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
            external
            payable
            returns (uint[] memory amounts);
    Just some guy
    @fubuloubu
    @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
    gunnertwin
    @gunnertwin
    @fubuloubu thanks! So it's not possible yet in Vyper or is there some dirty workaround?
    Ben Scherrey
    @scherrey
    @gunnertwin when we've done cross-language compatibility with Solidity we always fixed a maximum size array parameter and then walked over it until hitting a zero. This works but it also means that you can't have a zero value as a parameter. One of Vyper's goals is to be able to predict maximum gas utilization. Dynamically sized array's sorta makes that impossible.
    This is a MAJOR problem for Ethereum because all the ERC specs are typically expressed in Solidity (which is a huge mistake, IMHO). It ends up imposing Solidity semantics on the Ethereum standards which is entirely inappropriate long term. We worked on the ERC-1155 standard specifically to ensure cross-language compatibility and the effort was well received but I doubt that anyone else is doing that for other standards.
    Just some guy
    @fubuloubu
    @scherrey I wish ERCs were specified as YAML
    https://eips.ethereum.org/EIPS/eip-2069
    would make it really easy for all tooling to import them in a cross-platform way
    Ben Scherrey
    @scherrey
    @fubuloubu I like that idea. They need to be clear, however, as to what semantics are supported. The biggest discrepancy we've encountered, of course, is dynamically sized values. Ethereum needs to decide if that's a thing that public contracts should support (I would argue against it going forward - it's fine for internal values for implementation languages such as Solidity) and make that part of the protocol definition so it's clear to language implementors.
    Johnny Dapp
    @RealJohnnyDapp_twitter
    I am curious about the future of Vyper. Will the pyton-based 'strain' ever reach a 1.* production version?
    Just some guy
    @fubuloubu
    It'll take some time, but yes the intent is to tick over to 1.x when we complete our first actual audit
    personally, I'm curious if Solidity ever goes 1.x lol
    but yeah, basically the way we designed the versioning system is that major revisions get audits
    so it's easy to tell when the last time it was audited was
    Johnny Dapp
    @RealJohnnyDapp_twitter
    I forgot that solidity is still sub 1.0. That's true. A couple of days ago I read the concensys audit document which is about 1 year old so I was wondering what the future beholds :-)
    And also to keep building up my Vyper skills. I picked it up way easier and faster than Solidity. Mostly I'm getting grips on data modelling and how to return multiple values correctly, like a flattened struct. And bulk inserting, if possible.
    Ben Scherrey
    @scherrey
    People shouldn't be allowed to deploy contracts that control money written in Solidity. It's truly malpractice.
    Evan Saulpaugh
    @esaulpaugh
    has it gotten much better since the DAO hack with all the breaking changes? I suppose there will always be an incentive to use assembly to save gas
    Ben Scherrey
    @scherrey
    They've fixed lots of bugs and introduced improvements but security has to be designed into a language/system from the beginning. Solidity is based on javascript - quite possibly the worst possible language for writing anything you want to be provably correct. Even the most recent exploited contracts had expensive audits run on them. You can't audit anything beyond a certain amount of complexity. You must have the system secure by design and incapable of representing bad constructs.
    Abdelkader ALLAM
    @aallamaa
    Hello everyone, I dont understand the default value for uint256 in the doc, currently it is showing 1 in the doc https://vyper.readthedocs.io/en/stable/types.html#initial-values in oldest version of the doc it was 0, and when i do tests on ganache i get 0 and not 1 by default, is it different when running on mainnet ?

    @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 ?

    Jake Rockland
    @jakerockland
    @aallamaa I think the docs just need to be regenerated, the docs were fixed in vyperlang/vyper#2268
    Jake Rockland
    @jakerockland
    I think this gets automagically regenereated when a new version is cut
    Abdelkader ALLAM
    @aallamaa

    @aallamaa I think the docs just need to be regenerated, the docs were fixed in vyperlang/vyper#2268

    Thanks Jake

    Sivakumar Arumugam
    @asiva
    Hey folks. Anyone know where I can find a dev for some quick work, preferably with experience of the Curve codebase. It's an integration thing.
    Kuttubek Kylychbekov
    @kuttubekj
    Hi.
    How to get size of an array in vyper? Is it possible?
    I mean the size of filled indexes
    gat
    @devgat
    What is array type?
    shashibtc
    @shashibtc
    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
    Kuttubek Kylychbekov
    @kuttubekj

    What is array type?

    address

    Johnny Dapp
    @RealJohnnyDapp_twitter

    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

    Interacting is a different story, web3.js / web3.py is a good starting point I guess. You need the address of the deployed contract and the ABI to talk to the ERC721 contract.
    Speaking of erc721: if I modify that erc721 script and add a small chunk of code that I can put a struct with token specific information in a hashmap (like tokenId and some token-specific properties in a struct like 'name','description','imageurl') will I break the erc721 standard by extending it?
    Both a function to insert/update the token-specific properties and a getTokenProperties function to read the information a specific token.
    shashibtc
    @shashibtc
    thanks @RealJohnnyDapp_twitter
    Currently when I am trying to compile ERC721 contract from link https://github.com/vyperlang/vyper/blob/master/examples/tokens/ERC721.vy
    I am getting error like - CompileError: substring not found
    please help
    Sahil sen
    @Sahilsen
    Hi can anyone help me with the compiling process?
    as the remote compiler in remix Vyper plugin doesn't work
    vasa
    @vasa-develop
    You should try using local compiler
    are you using vs-code?
    gat
    @devgat
    @kuttubekj You should use a for loop at array length to see if specified index is ZERO_ADDRESS, if not you can accept it as a valid address and add to the number of filled indexes.
    vasa
    @vasa-develop

    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

    Sahil sen
    @Sahilsen
    Hey @vasa-develop thanks for the prompt reply
    Sahil sen
    @Sahilsen
    would you mind guiding me to use local compiler?