AxelarAmplifierGateway is the contract that allows apps on EVM chains to send and receive cross-chain messages via the Axelar Amplifier protocol. It handles cross-chain message passing (implemented by BaseAmplifierGateway), and signer rotation (implemented by BaseWeightedMultisig).
bytes32 AXELAR_AMPLIFIER_GATEWAY_SLOT
This slot contains the storage for this contract in an upgrade-compatible manner keccak256(‘AxelarAmplifierGateway.Slot’) - 1;
struct AxelarAmplifierGatewayStorage {
address operator;
}
constructor(uint256 previousSignersRetention_, bytes32 domainSeparator_, uint256 minimumRotationDelay_) public
Initializes the contract.
Name | Type | Description |
---|---|---|
previousSignersRetention_ | uint256 | The number of previous signers to retain |
domainSeparator_ | bytes32 | The domain separator for the signer proof |
minimumRotationDelay_ | uint256 | The minimum delay required between rotations |
modifier onlyOperatorOrOwner()
function _setup(bytes data) internal
Internal function to set up the contract with initial data. This function is also called during upgrades.
The setup data consists of an optional new operator, and a list of signers to rotate too. This function should be implemented in derived contracts.
Name | Type | Description |
---|---|---|
data | bytes | Initialization data for the contract |
function contractId() external pure returns (bytes32)
Returns the contract ID. It can be used as a check during upgrades.
Meant to be overridden in derived contracts.
Name | Type | Description |
---|---|---|
[0] | bytes32 | bytes32 The contract ID |
function approveMessages(struct Message[] messages, struct Proof proof) external
Approves an array of messages, signed by the Axelar signers.
Name | Type | Description |
---|---|---|
messages | struct Message[] | The array of messages to verify. |
proof | struct Proof | The proof signed by the Axelar signers for this command. |
function rotateSigners(struct WeightedSigners newSigners, struct Proof proof) external
Rotate the weighted signers, signed off by the latest Axelar signers.
The minimum rotation delay is enforced by default, unless the caller is the gateway operator. The gateway operator allows recovery in case of an incorrect/malicious rotation, while still requiring a valid proof from a recent signer set. Rotation to duplicate signers is rejected.
Name | Type | Description |
---|---|---|
newSigners | struct WeightedSigners | The data for the new signers. |
proof | struct Proof | The proof signed by the Axelar verifiers for this command. |
function validateProof(bytes32 dataHash, struct Proof proof) external view returns (bool isLatestSigners)
This function takes dataHash and proof and reverts if proof is invalid
Name | Type | Description |
---|---|---|
dataHash | bytes32 | The hash of the data being signed |
proof | struct Proof | The proof from Axelar signers |
Name | Type | Description |
---|---|---|
isLatestSigners | bool | True if provided signers are the current ones |
function operator() external view returns (address)
Returns the address of the gateway operator.
Name | Type | Description |
---|---|---|
[0] | address | The address of the operator. |
function transferOperatorship(address newOperator) external
Transfer the operatorship to a new address.
The owner or current operator can set the operator to address 0.
Name | Type | Description |
---|---|---|
newOperator | address | The address of the new operator. |
function _transferOperatorship(address newOperator) internal