Weighted Multisig executor to call functions on any contract
bytes32 INTERCHAIN_MULTISIG_SLOT
bytes32 chainNameHash
Returns the hash of the chain name
| Name | Type | Description | | —- | —- | ———– |
struct InterchainMultisigStorage {
mapping(bytes32 => bool) isBatchExecuted;
}
constructor(string chainName, bytes32 domainSeparator_, struct WeightedSigners signers) public
Contract constructor
Sets the initial list of signers and corresponding threshold.
Name | Type | Description |
---|---|---|
chainName | string | The name of the chain |
domainSeparator_ | bytes32 | |
signers | struct WeightedSigners | The weighted signers payload |
modifier onlySelf()
function isBatchExecuted(bytes32 batchId) external view returns (bool)
Checks if a payload has been executed
Name | Type | Description |
---|---|---|
batchId | bytes32 | The hash of the payload payload |
Name | Type | Description |
---|---|---|
[0] | bool | True if the payload has been executed |
function executeCalls(bytes32 batchId, struct IInterchainMultisig.Call[] calls, struct Proof proof) external payable
Executes an external contract call. This function is protected by the onlySigners requirement.
Executes a batch of calls with specified target addresses, calldata and native value. The proof data should have signers, weights, threshold and signatures encoded The signers and signatures should be sorted by signer address in ascending order
Name | Type | Description |
---|---|---|
batchId | bytes32 | The batchId of the multisig |
calls | struct IInterchainMultisig.Call[] | The batch of calls to execute |
proof | struct Proof | The multisig proof data |
function validateProof(bytes32 dataHash, struct Proof proof) external view returns (bool isLatestSigners)
This function takes dataHash and proof data and reverts if proof is invalid
Name | Type | Description |
---|---|---|
dataHash | bytes32 | The hash of the message that was signed |
proof | struct Proof | The data containing signers with signatures |
Name | Type | Description |
---|---|---|
isLatestSigners | bool | True if provided signers are the current ones |
function rotateSigners(struct WeightedSigners newSigners) external
Rotates the signers of the multisig This function is protected by the onlySelf modifier.
This function is only callable by the contract itself after signature verification
Name | Type | Description |
---|---|---|
newSigners | struct WeightedSigners | The new weighted signers encoded as bytes |
function withdraw(address recipient, uint256 amount) external
Withdraws native token from the contract. This function is protected by the onlySelf modifier.
This function is only callable by the contract itself after signature verification
Name | Type | Description |
---|---|---|
recipient | address | The recipient of the native value |
amount | uint256 | The amount of native value to withdraw |
function noop() external view
This function can be used to void a batch id from being executed in the future. This can be helpful to void an already signed but not yet executed batch. This function is protected by the onlySelf modifier.
This function is only callable by the contract itself after signature verification
receive() external payable
Allow contract to be able to receive native value