NEWTON

NEWTON


Popular tags

    Does anyone know how to print a uint256 in protostar tests?

    Asked

    2 months ago

    39

    views


    0

    This question has a bounty of $0.00 in testnet ETH. Answers to this question are eligible to win that bounty.

    These are testnet contracts. Not real ETH.

    $0.00

    Does anyone know how to print a uint256 in protostar tests?

    let (local balance) = IERC20.balanceOf(asset, owner);
    %{
        balance = reflect.balance.get()
        print("current owner balance: ", balance)
    %}
    

    this errors out: https://github.com/software-mansion/protostar/issues/1129

      cairotestinguint256debug

    Newton

    asked

    2 months ago


    1 answers

    0

    Accepted answer

    this worked:

    let (local balance) = IERC20.balanceOf(contract_address=asset, account=owner);
    let bal = balance.low;
    %{ print("current owner balance: ", ids.bal) %}
    

    Interestingly, reflect still didn’t work on bal.

    Newton

    answered

    2 months ago

    Answer is not submitted on chain

    Your answer

    NEWTON

    NEWTON