Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I pay for the storage deposit? #8

Open
josemariasosa opened this issue Jan 14, 2023 · 0 comments
Open

How should I pay for the storage deposit? #8

josemariasosa opened this issue Jan 14, 2023 · 0 comments

Comments

@josemariasosa
Copy link

josemariasosa commented Jan 14, 2023

Hi Aurora,

I'm trying to deploy the staking-farm contract by following the HowTo.md (here: https://github.com/referencedev/staking-farm/blob/master/HowTo.md).

This step:

  1. Deploying the contract into the factory requires the nearcall tool installed before:
    $ near call -account ${MASTERACC} -contract factory.${MASTERACC} -args staking_farm_local.wasm
    This will return an "Argument hash" that is required for later, and success/failure information of the deployment call.
    Make the argument hash globally available:
    $ export CONTRACTHASH=HxT6MrNC7...

is not possible to run. So, I'm running it like this:

go run ~/go/src/github.com/aurora-is-near/near-api-go/cmd/nearcall/nearcall.go -account ${MASTERACC} -contract factory.${MASTERACC} -args staking_farm_local.wasm

and it is returning me this error, because well some storage deposit is required

(string) (len=14) "ExecutionError": (string) (len=120) "Smart contract panicked: panicked at 'Must at least deposit 3179240000000000000000000', staking-factory/src/lib.rs:393:5"

The problem is that the amount in the nearcall tool is hard-coded to 0. As you can see here:

resp, err := account.FunctionCall(contract, method, args, 100_000_000_000_000, *(big.NewInt(0)))

I tried to change that line to:

 resp, err := account.FunctionCall(contract, method, args, 100_000_000_000_000, *(big.NewInt(3179240000000000000000000)))

But it's failing because the amount Overflows Int64.

Please help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant