axelar-gmp-sdk-solidity

Solidity API

FinalProxy

The FinalProxy contract is a proxy that can be upgraded to a final implementation that uses less gas than regular proxy calls. It inherits from the Proxy contract and implements the IFinalProxy interface.

FINAL_IMPLEMENTATION_SALT

bytes32 FINAL_IMPLEMENTATION_SALT

constructor

constructor(address implementationAddress, address owner, bytes setupParams) public

Constructs a FinalProxy contract with a given implementation address, owner, and setup parameters.

Parameters

Name Type Description
implementationAddress address The address of the implementation contract
owner address The owner of the proxy contract
setupParams bytes Parameters to setup the implementation contract

implementation

function implementation() public view returns (address implementation_)

The final implementation address takes less gas to compute than reading an address from storage. That makes FinalProxy more efficient when making delegatecalls to the implementation (assuming it is the final implementation).

Return Values

Name Type Description
implementation_ address The address of the final implementation if it exists, otherwise the current implementation

isFinal

function isFinal() external view returns (bool)

Checks if the final implementation has been deployed.

Return Values

Name Type Description
[0] bool bool True if the final implementation exists, false otherwise

_finalImplementation

function _finalImplementation() internal view virtual returns (address implementation_)

Computes the final implementation address.

Return Values

Name Type Description
implementation_ address The address of the final implementation, or the zero address if the final implementation has not yet been deployed

finalUpgrade

function finalUpgrade(bytes bytecode, bytes setupParams) external returns (address finalImplementation_)

Upgrades the proxy to a final implementation.

Parameters

Name Type Description
bytecode bytes The bytecode of the final implementation contract
setupParams bytes The parameters to setup the final implementation contract

Return Values

Name Type Description
finalImplementation_ address The address of the final implementation contract