Skip to content

Commit

Permalink
contracts: more subcall documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist committed Sep 17, 2023
1 parent 2f27062 commit a70ea0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contracts/contracts/Subcall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ library Subcall {
string private constant CONSENSUS_WITHDRAW = "consensus.Withdraw";
string private constant ACCOUNTS_TRANSFER = "accounts.Transfer";

/// Address of the SUBCALL precompile
address internal constant SUBCALL =
0x0100000000000000000000000000000000000103;

Expand Down Expand Up @@ -45,6 +46,14 @@ library Subcall {
(status, data) = abi.decode(tmp, (uint64, bytes));
}

/**
* @dev Generic method to call `{to:address, amount:uint128}`
* @param method Runtime SDK method name ('module.Action')
* @param to Destination address
* @param value Amount specified
* @return status Non-zero on error
* @return data Module name on error
*/
function _subcallWithToAndAmount(
string memory method,
StakingAddress to,
Expand Down

0 comments on commit a70ea0b

Please sign in to comment.