Endpoint

EndPoint contract

Contract entry point for operation executing by executor to destination protocol Also contract contain GOV-protocol logic for adding and verify new protocols and transmitters

Endpoint__InvalidProtocolId

error Endpoint__InvalidProtocolId(bytes32)

Endpoint__ExecutorIsNotAllowed

error Endpoint__ExecutorIsNotAllowed(bytes32, address, address)

Endpoint__ExecutorIsAlreadyAllowed

error Endpoint__ExecutorIsAlreadyAllowed(bytes32, address)

Endpoint__ProtocolIsNotAllowed

error Endpoint__ProtocolIsNotAllowed(bytes32, address)

Endpoint__ProtocolIsNotAdded

error Endpoint__ProtocolIsNotAdded(bytes32)

Endpoint__OpIsNotApproved

error Endpoint__OpIsNotApproved(uint256)

Endpoint__OpIsAlreadyExecuted

error Endpoint__OpIsAlreadyExecuted(uint256)

Endpoint__OpIsNotForThisChain

error Endpoint__OpIsNotForThisChain(uint256)

Endpoint__IsNotAllowedProposer

error Endpoint__IsNotAllowedProposer(address)

Endpoint__ZeroTransmittersCount

error Endpoint__ZeroTransmittersCount(bytes32)

Endpoint__AddrTooBig

error Endpoint__AddrTooBig(bytes32)

Endpoint__SelectorTooBig

error Endpoint__SelectorTooBig(bytes32)

Endpoint__ParamsTooBig

error Endpoint__ParamsTooBig(bytes32)

ProposalExecuted

event ProposalExecuted(uint256 opHash, bool success, bytes ret)

Propose

event Propose(bytes32 protocolId, bool inOrder, uint256 nonce, uint256 dstChainId, bytes protocolAddress, bytes functionSelector, bytes params)

ADMIN

bytes32 ADMIN

GOV

bytes32 GOV

govProtocolId

bytes32 govProtocolId

Signature

struct Signature {
  uint8 v;
  bytes32 r;
  bytes32 s;
}

AllowedProtocolInfo

struct AllowedProtocolInfo {
  bool isCreated;
  uint256 consensusTargetRate;
}

numberOfAllowedTransmitters

mapping(bytes32 => uint256) numberOfAllowedTransmitters

allowedTransmitters

mapping(bytes32 => mapping(address => bool)) allowedTransmitters

executors

mapping(bytes32 => mapping(address => bool)) executors

allowedProposers

mapping(bytes32 => mapping(address => bool)) allowedProposers

allowedProtocolInfo

mapping(bytes32 => struct EndPoint.AllowedProtocolInfo) allowedProtocolInfo

protocol info map

protocolAddressToProtocolId

mapping(address => bytes32) protocolAddressToProtocolId

map of protocol contract address to protocol id

opExecutedMap

mapping(uint256 => bool) opExecutedMap

map of executed operations

rateDecimals

uint256 rateDecimals

10000 = 100%

masterSmartContract

bytes masterSmartContract

eobChainId

uint256 eobChainId

globalNonce

uint256 globalNonce

protocolNonce

mapping(bytes32 => uint256) protocolNonce

_isAllowedExecutorInternal

function _isAllowedExecutorInternal(bytes _protocolAddr) internal view

END of VARS *

isAllowedExecutor

modifier isAllowedExecutor(bytes _protocolAddr)

_isAllowedProtocolInternal

function _isAllowedProtocolInternal(bytes _protocolAddr) internal view

isAllowedProtocol

modifier isAllowedProtocol(bytes _protocolAddr)

_isAllowedProposerInternal

function _isAllowedProposerInternal(bytes32 protocolId) internal view

isAllowedProposer

modifier isAllowedProposer(bytes32 protocolId)

_isValidProtocol

function _isValidProtocol(bytes32 _protocolId) internal view

isValidProtocol

modifier isValidProtocol(bytes32 _protocolId)

initialize

function initialize(address[1] initAddr, uint256 _eobChainId) public

_authorizeUpgrade

function _authorizeUpgrade(address) internal

__chainId

function __chainId() internal view returns (uint256 id)

addGov

function addGov(address govAddress, uint256 consensusTargetRate, address[] govTransmitters, address[] govExecutors, address _masterSmartContract) external

Adding gov contract and first gov transmitters

Parameters

addAllowedProtocol

function addAllowedProtocol(bytes32 _protocolId, uint256 _consensusTargetRate, address[] _transmitters) external

Adding protocol to whitelist

Parameters

addAllowedProtocolAddress

function addAllowedProtocolAddress(bytes32 _protocolId, address _protocolAddress) external

Adding protocol contract address to whitelist

Parameters

removeAllowedProtocolAddress

function removeAllowedProtocolAddress(bytes32 _protocolId, address _protocolAddress) external

Removing protocol contract address from whitelist

Parameters

addAllowedProposer

function addAllowedProposer(bytes32 _protocolId, address _proposer) external

Adding proposer to whitelist

Parameters

removeAllowedProposer

function removeAllowedProposer(bytes32 _protocolId, address _proposer) external

Removing proposer to whitelist

Parameters

addExecutor

function addExecutor(bytes32 _protocolId, address _executor) external

Adding executor to whitelist

Parameters

removeExecutor

function removeExecutor(bytes32 _protocolId, address _executor) external

Removing executor from whitelist

Parameters

addTransmitters

function addTransmitters(bytes32 _protocolId, address[] _transmitters) external payable

Adding transmitters to whitelist (payable is cheaper in gas cost)

Parameters

removeTransmitters

function removeTransmitters(bytes32 _protocolId, address[] _transmitters) external payable

Removing transmitters from whitelist (payable is cheaper in gas cost)

Parameters

setConsensusTargetRate

function setConsensusTargetRate(bytes32 _protocolId, uint256 rate) external

Setting of target rate

Parameters

checkOperationsExecuteStatus

function checkOperationsExecuteStatus(uint256[] opHashArray) public view returns (bool[] resultArray)

Get array of opHashes, check it was executed and returns array of result

Parameters

Return Values

executeOperation

function executeOperation(struct OperationLib.OperationData opData, struct EndPoint.Signature[] transmitterSigs) external payable

execute approved operation

Parameters

checkProposeData

function checkProposeData(bytes32 protocolId, uint256 protocolAddressLen, uint256 functionSelectorLen, uint256 paramsLen) internal pure

propose

function propose(bytes32 protocolId, uint256 dstChainId, bytes protocolAddress, bytes functionSelector, bytes params) external

function of emitting event Propose for catching by transmitters

Parameters

proposeInOrder

function proposeInOrder(bytes32 protocolId, uint256 dstChainId, bytes protocolAddress, bytes functionSelector, bytes params) external

function of emitting event Propose with order for catching by transmitters

Parameters

Last updated