Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    webelf101
    @webelf101
    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
    Gianluca Mazza
    @gianlucamazza
    I'm happy to be here, I just started learning vyper
    i've stupid question but I cannot use maps in my code, I have this error: No builtin or user-defined type named 'map'
    hello everybody
    Gianluca Mazza
    @gianlucamazza

    this is what I did:

    activedVaults: public(map(uint256, uint256))

    El De-dog-lo
    @fubuloubu

    there is a #vyper channel in the Python EthDev discord. Please join the discussion there: https://discord.gg/FwuxuvGSjz

    casual reminder

    Captain UndyPants
    @CapUndyPants
    CleanShot 2021-07-21 at 20.20.52.png
    Any ideas why that won't even compile?
    AttributeError: 'StructType' object has no attribute 'typ'
    Captain UndyPants
    @CapUndyPants
    It compiles in 0.2.8 but not in 0.2.12
    Captain UndyPants
    @CapUndyPants
    I asked over in discord. It's a bug, I created an issue.
    lorianqorraj
    @lorianqorraj
    @fubuloubu hi, hope to find you well! can you perhaps send me the link to discord? unable to join
    image.png
    this is the error I would like to post
    lorianqorraj
    @lorianqorraj
    resloved, but if there is any community I can join pls let me know.
    El De-dog-lo
    @fubuloubu
    there is a #vyper channel in the Python EthDev discord. Please join the discussion there: https://discord.gg/jDZVkcTCqs

    @fubuloubu hi, hope to find you well! can you perhaps send me the link to discord? unable to join

    I updated the link!

    lorianqorraj
    @lorianqorraj
    image.png
    thank you, unfortunately still now working. can you perhaps send it again?
    Sam Lavery
    @samlavery
    how are people doing their contract debugging?
    Evan Saulpaugh
    @esaulpaugh
    I'll try discord
    Neil Henegan
    @neilh
    @gonchs did you ever get that aave bytes array flashloan receiver issue figured out? I'm looking for a similar solution at the moment.
    Ben Scherrey
    @scherrey
    Trying to build an old Vyper contract from over a year ago (required a patched beta version at the time) with a new (0.3.0) vyper compiler. Used to be able to declare an array of HashMaps but this, formerly legal declaration, "levels: public(HashMap(uint256, Bid)[MAX_LEVEL])" now gives this error message: "vyper.exceptions.StructureException: HashMap must be defined with a key type and a value type". How can I get an array of HashMaps with modern Vyper?
    Orpheus
    @o:matrix.orpheuslummis.info
    [m]
    There was a security assessment of Vyper a while back. Is there a recent write-up about how the issues were handled since?
    SunTeco
    @SunTeco
    Hallo
    JChoy
    @JhChoy
    Hi, I have a basic question with raw_call. When the internal call reverted, does raw_call revert the transaction or just return the result?
    Ben Scherrey
    @scherrey

    Hi, I have a basic question with raw_call. When the internal call reverted, does raw_call revert the transaction or just return the result?

    Any exception thrown in an EVM execution will result in a reversion/abandonment of the tx. My understanding is that's fundamental to the EVM and not anything the language has an impact on.

    3 replies
    Obiajulu
    @ObiajuluM
    hello
    vyper.fun is currently down any plans to fix it?
    Ben Scherrey
    @scherrey
    The github is still around. https://github.com/vyperfun/vyper.fun No idea about the site. Wasn't aware of it.
    And apparently there's a discord channel for it as well which you'll find in the above repo.
    Obiajulu
    @ObiajuluM
    hello
    image.png
    can i embed structs in vyper? e.g
    Obiajulu
    @ObiajuluM
    yes you can
    i just tried it
    kenfelix
    @kenfelix
    hello engineers
    please how do i convert a string type to bytes
    KevenNock
    @KevenNock
    hi, someone there ? need help, every time i compile my vype file use remix , it dose not work
    hanbu97
    @hanbu97

    hi, im new in vyper. Import function from another file is quite confused.

    I defined a internal pure func in one.vy like this

    @internal
    @pure
    def AddOne(x: uint256) -> uint256:
        return x + 1

    then i wanna import it in two.vy

    from contracts.one import AddOne
    
    @external
    @pure
    def AddOneTest(x: uint256) -> uint256:
        return AddOne(x)

    but an error occured on last line:

    vyper.exceptions.TypeMismatch: Given reference has type uint256, expected address

    my vyper version is 0.3.1. What should I do.

    NEED HELP

    2 replies
    topSkr
    @topSkr
    I want to use the solidity table @nonreentrant('lock') how to express
    1 reply
    huangjiahuan
    @huangjiahuan
    Hi, I cannot compiler a vyper contract in remix. Neither remote nor local can succeed.My local vyper-server didn’t show error. Can someone help me?
    ichthyx
    @ichthyx
    How can I hardcode a wallet variable for a admin_only function ?
    I tried :
    ADMIN_WITHRAW_ADR: constant(address) = 0x......
    then assert msg.sender == ADMIN_WITHRAW_ADR, "reserved to Admin"
    But return false even when my wallet is the admin wallet not sure why
    adrees-scytalelabs
    @adrees-scytalelabs
    Hi... how are you all... hope you all doing great... i have a question about raw_call

    I am new to Vyper. I was analyzing the contract there I saw raw_call in a method

    raw_call(reward_contract, self.claim_sig)

    its permalink: https://github.com/curvefi/curve-dao-contracts/blob/3bee979b7b6293c9e7654ee7dfbf5cc9ff40ca58/contracts/gauges/RewardsOnlyGauge.vy#L113

    and claim_sig Four-byte selectors for staking, withdrawing, and claiming, left padded with zero bytes. If the reward contract can be claimed from but does not require staking, the staking and withdraw selectors should be set to 0x00

    its permalink: https://github.com/curvefi/curve-dao-contracts/blob/3bee979b7b6293c9e7654ee7dfbf5cc9ff40ca58/contracts/gauges/RewardsOnlyGauge.vy#L427-L430

    more about sigs: A concatenation of three four-byte function signatures: stake, withdraw, and getReward. The signatures are then right padded with empty bytes. See the example below for more information on how to prepare this data.

    An example of generating the signatures input and enabling a vanilla SNX rewards contract:

    Rewards = Contract("0x99ac10631f69c753ddb595d074422a0922d9056b")

    first, we get the signatures for depositing, withdrawing and claiming sigs = [rewards.stake.signature, rewards.withdraw.signature, rewards.getReward.signature] sigs ["0xa694fc3a", "0x2e1a7d4d", "0x3d18b912"]

    now we remove the leading 0x and concatentate them sigs = "".join(i[2:] for i in sigs) sigs "a694fc3a2e1a7d4d3d18b912"

    finally, we add the leading 0x and trailing 00 bytes sigs = "0x" + sigs + ("00" * 20) sigs "0xa694fc3a2e1a7d4d3d18b9120000000000000000000000000000000000000000"

    now we are ready to set the rewards contract gauge.set_rewards(rewards, sigs, [reward_token] + [ZERO_ADDRESS] * 7, {'from': alice})

    and the question is:

    as it says there are three signatures... does raw_call calls every function? and how is it passing their parameters?

    Royzac
    @Royzac
    Why use bytes as an argument? How does method_id work, why is it used?
    I"m receiving a revert from a safeTransferFrom call and I realize I don't quite understand what that operation is doing.