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

Campaign deletion errors out due to storage costs #3

Closed
jorgeavaldez opened this issue Sep 5, 2021 · 2 comments · Fixed by #4
Closed

Campaign deletion errors out due to storage costs #3

jorgeavaldez opened this issue Sep 5, 2021 · 2 comments · Fixed by #4

Comments

@jorgeavaldez
Copy link
Contributor

jorgeavaldez commented Sep 5, 2021

Looks like it errors out when calling campaign.clear_state

Screen Shot 2021-09-05 at 3 52 42 PM

errors.js:18 Uncaught (in promise) Error: The account  wouldn't have enough balance to cover storage, required to have 131319891695763869741440 yoctoNEAR more
    at Object.parseRpcError (rpc_errors.js:41)
    at json-rpc-provider.js:169
    at async Object.exponentialBackoff [as default] (exponential-backoff.js:7)
    at async JsonRpcProvider.sendJsonRpc (json-rpc-provider.js:154)
    at async account.js:94
    at async Object.exponentialBackoff [as default] (exponential-backoff.js:7)
    at async Account.signAndSendTransaction (account.js:90)
    at async Contract.clear_state (Сontract.js:39)
    at async Object.[Symbol.asyncIterator] (onDeleteCampaign.js:15)
    at async Object.fn (onDeleteCampaign.js:53)
@jorgeavaldez jorgeavaldez changed the title Can't delete campaigns Campaign deletion errors out due to storage costs Sep 5, 2021
@jorgeavaldez
Copy link
Contributor Author

I resolved this by bumping the initial campaign contract storage amount by 0.2 near and adding .01 to each link

https://github.com/NEAR-labs/ui.near-linkdrop/blob/master/src/store/campaigns/thunks/onCreateCampaign.js#L12

  const res = 2.7 + totalKeys * (Number(amountPerLink) + 0.03); // TODO change coefficients

@eclipseeer
Copy link
Contributor

Thanks for your contribution, I'll check it and merge

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

Successfully merging a pull request may close this issue.

2 participants