by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Just some guy
    @fubuloubu
    @jmerestain thanks for posting the full contract, can you post the error you're getting?
    Just some guy
    @fubuloubu
    I found it! Line 57:
    https://gist.github.com/jmerestain/1fedae27097e174af00ab84af25d0d40#file-smartcontract-vy-L57
    result: uint256 = factorX * factorY * (10 ** -3)
    10 ** -3 is 0.001, which is not a valid uint256 value. Good find!
    try result: uint256 = (factorX * factorY) / (10 ** 3) instead
    jmerestain
    @jmerestain
    Ahh I see thank you very much!! really appreciate it
    Just some guy
    @fubuloubu
    No problem, I hadn't seen that bug before lol
    jmerestain
    @jmerestain
    I came across another problem I needed to ask about

    https://gist.github.com/jmerestain/34c45e2356303ff6a1c3cf82e5a2955e

    when calling this method on the main chain, it requires 999+k gas

    but on the Remix debugger it only uses around 68k gas
    jmerestain
    @jmerestain
    on the Javascript EVM
    Just some guy
    @fubuloubu
    that's really weird. you're saying what metamask estimates for the call is ~1m gas?
    jmerestain
    @jmerestain
    yeah
    Remix gives me the error when I allocate 300k gas
    somewhere along the lines of "the transaction will fail unless it has 999k gas"
    insufficient gas allocation

    https://etherscan.io/token/0x0d8fc15b6fefc278ff642861df51b45607330871#writeContract

    this is the contract I set deployed on mainnet, which is very weird since on the JSVM it only gets 68k gas

    having some troubles seeing where the huge gas requirements come from with that code, it's just the ERC20.vy with a 2 2-3 line methods added and a few asserts put in place
    Just some guy
    @fubuloubu
    Yeah, I don't see anything either. Must be a bug in the JSVM's gas estimation because of something Vyper does slightly differently than Solidity
    weird
    jmerestain
    @jmerestain
    not just 999k apparently, reading was wrong; 9.9M gas
    I found the problem, apparently there was an assert. if it didn't pass it would shoot up the gas to 9.9m
    Just some guy
    @fubuloubu
    that's weird, our assert statement returns the remainder of the gas
    Ghost
    @ghost~5ab0d1ebd73408ce4f92358d
    Hello all :) Just a quick question, does Vyper support deployment of a contract within some other parent contract?
    Just some guy
    @fubuloubu
    No, not like in Solidity
    your choices are to either using create_forwarder_to like Uniswap does: https://vyper.readthedocs.io/en/latest/built-in-functions.html#create_forwarder_to
    the typical Solidity factory pattern creates a lot of overhead in terms of code size and gas costs
    Sergey Goncharov
    @gonchs
    Any ideas how to assign a tuple (uint, uint, unit) return value from a Solidity contract to a local variable in Vyper? And how should the interface definition look like?
    Just some guy
    @fubuloubu
    contract Bar: 
        def baz() -> (uint256, uint256, uint256): constant 
    
    @public 
    def foo(): 
        a: uint256 = 0 
        b: uint256 = 0 
        c: uint256 = 0 
        a, b, c = Bar(a).baz()
    you just have to declare them all first
    Spencer Harris
    @spencerbh
    I am looking at ERC-721 implementations in Vyper and its seems like nobody has fully implemented the spec? is this true? Im specificially interested in the ERC721Metadata option. Looks like the OxCert implementation moved to Solidity?
    Sergey Goncharov
    @gonchs
    I need to call a function called "swap" on an external contract. When I try to define the interface, I get an error: "Function name invalid. swap is a reserved keyword (Vyper language)". Is there any way around this? Or is raw_call my only option?
    Sergey Goncharov
    @gonchs
    What is the swap keyword used for? Can't find anything in the docs.
    Ben Hauser
    @iamdefinitelyahuman
    @gonchs SWAP is an opcode, i think that's why it's included in the reserved keywords
    well... SWAP{n} where n is 1-16
    are you defining the interface in vyper code or via an ABI?
    Sergey Goncharov
    @gonchs
    in vyper code
    Ben Hauser
    @iamdefinitelyahuman
    it might work to implement it via an ABI. if it doesn't, i feel like it probably should and might be worth opening an issue over.
    Sergey Goncharov
    @gonchs
    I have zero knowledge in how to write a programming language itself but shouldn't interpreter only "translate" words that are explicitly set that it should translate? I don't see "swap" used anywhere by doing the search on the repo: https://github.com/vyperlang/vyper/search?q=swap&unscoped_q=swap While the rest of the reserved keywords are used. Could this be a bug?
    I'm thinking of removing "swap" from the reserved keywords and compiling vyper just to see if it would work. But it would probably be faster for me to just use raw_call.
    Sergey Goncharov
    @gonchs
    Opened an issue: vyperlang/vyper#1938
    Ben Hauser
    @iamdefinitelyahuman
    yeah, i can't find much looking through past issues or at git blame. we'll discuss it on the next call for sure.
    Sergey Goncharov
    @gonchs
    Is there a docker for vyper-json?
    Just some guy
    @fubuloubu
    No, but we could make one. Can you open an issue for that? (publish vyper-json in docker image)
    Jacques Wagener
    @jacqueswww
    I think we should remove the opcodes check
    Never really made sense that you could inject opcodes like that.
    Jacques Wagener
    @jacqueswww
    In 3.9 beta