'Everscale Solidity error by timeout: code: 3025 Contract execution was terminated with error
Free TON Solidity code or execution error. Can't understand my mistake, I already compact the code to the minimum:
cat ./SimpleStorage.sol
pragma solidity >=0.6.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}
tonos-cli call 0:efbeed7533cae6f12869b665b610c30535397c5c1523f6b41561905807aed958 set '{"x":100}' --abi ./SimpleStorage.abi.json
Input arguments: address: 0:efbeed7533cae6f12869b665b610c30535397c5c1523f6b41561905807aed958 method: set params: {"x":100} abi: ./SimpleStorage.abi.json
Then in result I get an error by timeout:
code: 3025 message: Contract execution was terminated with error
Solution 1:[1]
You need to enable gas before You store variables. tvm.accept can do it.
function set(uint x) public {
tvm.accept();
storedData = x;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Mikki Ukraine |