gear icon indicating copy to clipboard operation
gear copied to clipboard

Gas reservation inside program

Open breathx opened this issue 3 years ago • 0 comments

Problem to Solve

Need to provide an ability to reserve some gas from given to use it for future actions inside the program (even over multiple execution, but it's relies on user-space).

It may look like this:

use gcore::exec; // or any other module

#[no_mangle]
pub unsafe extern "C" fn handle() {
    let reservation_id = exec::reserve_gas(5_000);
}

Using this stored reservation_id program will be able to use that gas.

Possible Solution

Need to expand ValueTree functionality to be able split off not only for messages, but for reservations also.

breathx avatar Feb 09 '22 09:02 breathx