1

I'm trying to upload the flipper contract to Beresheet (Edgeware testnet) but after submitting, I got this contract.NewContractNotFunded error and the extrinsic failed. I search the error on Google and found this description:

The newly created contract is below the subsistence threshold after executing its contructor. No contracts are allowed to exist below that threshold.

And this:

Subsistence Threshold
The runtime must make sure that any allowed dispatchable makes sure that the total_balance of the contract stays above Pallet::subsistence_threshold(). Otherwise users could clutter the storage with contracts.

What exactly the total_balance of a contract is? How can I resolve this problem?

Side question: Is there anyway to call a smart contract in the polkadot.js UI?

1 Answer 1

1

with the Edgeware-specified contracts pallet,

https://github.com/webb-tools/substrate/blob/656e206faaf0353c7e7f14689779379018bbb02a/frame/contracts/src/lib.rs#L771-L780

    /// Subsistence threshold is the extension of the minimum balance (aka existential deposit)
    /// by the tombstone deposit, required for leaving a tombstone.
    ///
    /// Rent or any contract initiated balance transfer mechanism cannot make the balance lower
    /// than the subsistence threshold in order to guarantee that a tombstone is created.
    ///
    /// The only way to completely kill a contract without a tombstone is calling `seal_terminate`.
    pub fn subsistence_threshold() -> BalanceOf<T> {
        T::Currency::minimum_balance().saturating_add(T::TombstoneDeposit::get())
    }

so it's basically sum of two constants, balances.existentialDeposit and contracts.TombstoneDeposit.

you can get these constants by querying chain state.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.