-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
DiscussionInitial issue state - proposed but not yet acceptedInitial issue state - proposed but not yet accepted
Description
Summary or problem description
This change allows contracts to add more GAS into engine during execution. This simplifies GAS calculations on complex contracts, so that more and more GAS can be required during runtime, depending on the situation.
Related to: neo-project/proposals#137
Do you have any solution you want to propose?
I propose that GAS Native Contract have some method like GAS.transferToSystem(scripthash, amount), where an amount of GAS is requested to be put on the engine executing the transaction.
Example:
// inside smart contract
RunBigCode();
// check if there's enough gas... if not, top-up more 0.1 GAS
GAS.transferToSystem(scripthash, 0.1); // this adds more 0.1 into ApplicationEngine, and takes from 'scripthash'
// run more code
RunBigCode();
// check if there's enough gas... if not, top-up more 0.1 GAS
GAS.transferToSystem(scripthash, 0.1);
// ...
Neo Version
- Neo 3
Where in the software does this update applies to?
- Ledger
- Other: ApplicationEngine
Metadata
Metadata
Assignees
Labels
DiscussionInitial issue state - proposed but not yet acceptedInitial issue state - proposed but not yet accepted