Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    El De-dog-lo
    @fubuloubu

    Does vyper output something akin to the metadata output of the solidity compiler?

    @wighawag No

    is Vyper compatible with BEP networks by default?

    @Tumble17 you mean Binance Chain? Yes, there are several things deployed there and working just fine.

    p.s. we started an Ethereum Python Dev discord, which has a #vyper channel! join here: https://discord.gg/FwuxuvGSjz
    Ronan Sandford
    @wighawag
    Ok, thanks @fubuloubu i suppose the vyper compiler is deterministic and so i can use the input + compiler version info to verify source later
    Gary Tse
    @tserg

    hi, I have been trying to deploy an ERC721 contract on Ropsten, but the token transfers do not show up in the transfers tab and it seems to be displayed as an ERC20 token: https://ropsten.etherscan.io/token/0xcBAcCb66dADa684B36Bea31F84615B66a3cc0234

    is this an issue with the code, or with Etherscan? the code is available on Etherscan

    Ghost
    @ghost~607263f36da037398479dc39
    Hi guys, how would implement an ERC1155 with vyper? im stuck with the batchbalance
    Alberto Gonzalez
    @QuetzalAzul
    Hi guys, how would implement an ERC1155 with vyper? im stuck with the batchbalance
    Ben Scherrey
    @scherrey
    You have to use fixed sized arrays as parameters and check their values for zero.
    85
    @eightyfive

    You have to use fixed sized arrays as parameters and check their values for zero.

    Not ideal but made my day, thanks @scherrey

    Ben Scherrey
    @scherrey
    @eightyfive indeed - I believe we actually wrote the first ever 1155 contract with Vyper and participated in cleaning up the 1155 specification in order to support cross-language compatibility. It's unfortunate that ERC specifications are always defined in terms of Solidity which is an utterly inappropriate language for writing decentralized contracts. I think the ethereum community is slowly recognizing this fact.
    85
    @eightyfive
    I did :)
    85
    @eightyfive
    @scherrey is your ERC1155 vyper implementation OSS ? I would love to take a look. Cheers.
    Ben Scherrey
    @scherrey
    @eightyfive sadly it belongs to the client who has not released it as far as I know. If it ever is I'll post a link to it here.
    NICKSAUNDERS
    @NICKSAUNDERS
    hello?
    Abdelkader ALLAM
    @aallamaa
    Hello Guys, any idea when we will get this feature ? vyperlang/vyper#1440 seems to be in the pipe since 2019. This is really one of the major missing feature of Vyper. Is there a work around currently to be able to receive dynamic sized parameters since lot of EIPS token format actually require such kind of parameters ?
    85
    @eightyfive

    You have to use fixed sized arrays as parameters and check their values for zero.

    @aallamaa @scherrey temp solution

    Abdelkader ALLAM
    @aallamaa
    @eightyfive thanks and it is working 100% ? Do you have example of code ? what is more than the sized array is sent ?
    Abdelkader ALLAM
    @aallamaa
    I meant 'what if the parameter contains more elements than the fixed array ?'
    El De-dog-lo
    @fubuloubu

    Is there a work around currently to be able to receive dynamic sized parameters

    No there isn't unfortunately.

    For making external calls with dynamic array args, that is possible if you play with raw_call
    you could probably find a 4-bytes collision name via name mining that fits the usecase of the call you need to provide for
    it would probably look something like adghsrgnsfgbs(bytes) for a function signature
    e.g. the name of the function is randomized
    then you could just process the arg data in def adghsrgnsfgbs(data: bytes) -> ... further
    unfortunately adding dynamic arrays into the language is not a very trivial thing, and has the capacity to add a lot of bugs into the language if not properly worked through
    Ben Scherrey
    @scherrey
    @aallamaa given the core architectural drivers of Vyper, sending dynamically sized arrays is a Bad Idea (TM). Solidity really shouldn't be doing it. The solution is not to add such support to Vyper but to abandon such bad practices in Solidity. To answer your other question, if a parameter higher than your fixed size is sent, Vyper simply won't have access to it.
    Abdelkader ALLAM
    @aallamaa
    Thanks @fubuloubu so basically we can't support standards like https://eips.ethereum.org/EIPS/eip-1155 who extensively use dynamic array like : function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external; and if @scherrey workaround works, we couldnt even work with function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); which also return a dynamic array which we couldnt construct with the right size
    Ben Scherrey
    @scherrey
    @aallamaa the standard should specify a maximum size for the dynamic array. And we found our 1155 Vyper contract worked quite well.
    Abdelkader ALLAM
    @aallamaa
    Thanks @scherrey
    El De-dog-lo
    @fubuloubu
    @scherrey I would say there are good use cases for dynamic arrays in Vyper, however people tend to overuse them in bad ways if given the option.
    For example, I think as call arguments, it's very handy to have, but for storage it's almost never a good idea

    Thanks @fubuloubu so basically we can't support standards like https://eips.ethereum.org/EIPS/eip-1155 who extensively use dynamic array like : function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external; and if @scherrey workaround works, we couldnt even work with function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); which also return a dynamic array which we couldnt construct with the right size

    Not yet, no. Not until vyperlang/vyper#1440 is implemented, which is high priority for us but has a number of issues that needs to be resolved first to be able to be added safely.

    If you look at some of Soldiity's past security disclosures, I think you'll find dynamic arrays are a frequent source of memory corruption issues that could become exploitable
    El De-dog-lo
    @fubuloubu
    btw, there is a #vyper channel in the Python EthDev discord. Please join the discussion there: https://discord.gg/FwuxuvGSjz
    I want to eventually archive this chat (if I can figure out how). I don't have notifications activated for this room.
    Ben Scherrey
    @scherrey
    @fubuloubu oh that's sad to hear. I really much prefer gitter to discord. I'm rarely ever on discord.
    El De-dog-lo
    @fubuloubu
    you are probably the only person I have ever heard say that lol
    Ben Scherrey
    @scherrey
    :-)
    mrteathyme
    @mrteathyme

    Just jumping in to ask because google is being completely unhelpful, do we have any current method for dealing with the incompatibility of vyper with dynamic array inputs for solidity contracts?

    Trying to spec out a uniswap v2 interface for a contract (because I have yet to find an open source one for vyper) and the return values for amounts and the path inputs straight up aren't possible with the current feature set (given no workaround exists)

    Do i just have to subject myself to the torture that is solidity or wait for v0.3?

    Yet another codejunkie
    @kn1g
    Hey, how does the Vyper compiler optimize if I use e.g. 10**18 multiple times in the code. Does it make sense to 'cache' it in a constant and reuse the constant or does the compiler resolves this and caches the value to save the recalculation each time?
    1 reply
    NICKSAUNDERS
    @NICKSAUNDERS
    how do I join from the console?
    Manuel
    @TeNNoX

    Hi there :)
    Can someone help me out how to concat a string with a uint256?
    concat("test", convert(_tokenId, Bytes[1]))

    Says expecting String for argument 1 of convert (I also tried different Bytes lengths, only bytes32 works - but it's a padded encoded string then)

    Manuel
    @TeNNoX
    But still help needed
    webelf101
    @webelf101
    Hi, everyone!
    How can I calculate X Y / Z in uint256? X Y is definitely bigger than 2 ** 256 but the result will in uint256 range.
    Evan Saulpaugh
    @esaulpaugh
    ((1/Z) X) Y ?
    Abdelkader ALLAM
    @aallamaa

    How can I calculate X Y / Z in uint256? X Y is definitely bigger than 2 ** 256 but the result will in uint256 range.

    X /Z Y + (X modulo Z) Y / Z

    something like that
    El De-dog-lo
    @fubuloubu
    there is a #vyper channel in the Python EthDev discord. Please join the discussion there: https://discord.gg/FwuxuvGSjz