patractlabs / redspot

Redspot is an Substrate pallet-contracts (ink!) development environment. Compile your contracts and run them on a different networks. Redspot's core forks from Hardhat but changed a lot to suit substrate.
https://redspot.patract.io/
Other
67 stars 22 forks source link

[Question] How do we send value into transaction calling payable contract functions? #137

Closed forgetso closed 2 years ago

forgetso commented 2 years ago

In polkadot api, assuming a contract with function called inc, you can do:

await contract
  .exec('inc', { value, gasLimit }, incValue)

In redspot, using this format contract.tx.inc(args) only allows the arguments of the contract function, not the value and gas limit.

How are the value and gas limit set in redspot?

forgetso commented 2 years ago

Nevermind, I see that the overrides are added after the function parameters:

contract.tx.inc(args, { gasLimit:1000000000, value:10 })