I am writing a token contract. it has a mint function. I test this function with rusk test. however, my test reverts with RevertTransactionError("Revert(18446744073709486081)"
#[storage(read, write)]
fn mint(recipient: Identity, amount: u64) {
_validate_owner();
storage.total_supply += amount;
mint_to(amount, recipient);
log(Mint{
recipient: recipient.into(),
amount: amount,
})
}
I manager to narrow down the error to the code mint_to(amount, recipient)
The contract method call went well if I remove the mint_to(amount, recipient)
code in sway contract.
And the test pass if i replace it with the std::token::mint
method.
this token mint_to
causes this weird revert.
full RevertTransactionError log
value: RevertTransactionError("Revert(18446744073709486081)", [Call { id: 0000000000000000000000000000000000000000000000000000000000000000, to: 526cd95eb58b14926a8a9b07178738dae8cae311326b7735e11a21573fb5ca72, amount: 0, asset_id: 0000000000000000000000000000000000000000000000000000000000000000, gas: 1000000, param1: 2713791341, param2: 10472, pc: 11680, is: 11680 }, Revert { id: 526cd95eb58b14926a8a9b07178738dae8cae311326b7735e11a21573fb5ca72, ra: 18446744073709486081, pc: 16952, is: 11680 }, ScriptResult { result: Revert, gas_used: 44827 }])
full code