Relayer

Git Source

State Variables

PROTOCOL

address public immutable PROTOCOL;

owner

address public owner;

priceOf

mapping(uint256 => DstPrice) public priceOf;

configOf

mapping(uint256 => DstConfig) public configOf;

approvedOf

mapping(address => bool) public approvedOf;

Functions

onlyOwner

modifier onlyOwner();

onlyApproved

modifier onlyApproved();

constructor

constructor(address dao, address ormp);

version

function version() public pure returns (string memory);

receive

receive() external payable;

withdraw

function withdraw(address to, uint256 amount) external onlyApproved;

isApproved

function isApproved(address operator) public view returns (bool);

changeOwner

function changeOwner(address newOwner) external onlyOwner;

setApproved

function setApproved(address operator, bool approve) public onlyOwner;

setDstPrice

function setDstPrice(uint256 chainId, uint128 dstPriceRatio, uint128 dstGasPriceInWei) external onlyApproved;

setDstConfig

function setDstConfig(uint256 chainId, uint64 baseGas, uint64 gasPerByte) external onlyApproved;

fee

function fee(uint256 toChainId, address, uint256 gasLimit, bytes calldata encoded, bytes calldata)
    public
    view
    returns (uint256);

relay

function relay(Message calldata message) external onlyApproved;

Events

SetDstPrice

event SetDstPrice(uint256 indexed chainId, uint128 dstPriceRatio, uint128 dstGasPriceInWei);

SetDstConfig

event SetDstConfig(uint256 indexed chainId, uint64 baseGas, uint64 gasPerByte);

SetApproved

event SetApproved(address operator, bool approve);

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

Structs

DstPrice

struct DstPrice {
    uint128 dstPriceRatio;
    uint128 dstGasPriceInWei;
}

DstConfig

struct DstConfig {
    uint64 baseGas;
    uint64 gasPerByte;
}