ExternalDeveloperHub

ExternalDeveloperHub__ChainIsNotSupported

error ExternalDeveloperHub__ChainIsNotSupported(uint256)

ExternalDeveloperHub__IsNotOwner

error ExternalDeveloperHub__IsNotOwner(bytes32, address)

ExternalDeveloperHub__ProtocolNotRegistered

error ExternalDeveloperHub__ProtocolNotRegistered(bytes32)

ExternalDeveloperHub__ExternalDeveloperNotApproved

error ExternalDeveloperHub__ExternalDeveloperNotApproved(address)

ExternalDeveloperHub__AddrTooBig

error ExternalDeveloperHub__AddrTooBig(bytes32)

ExternalDeveloperHub__ProtocolAlreadyExists

error ExternalDeveloperHub__ProtocolAlreadyExists(bytes32)

ExternalDeveloperHub__DuplicateTransmitter

error ExternalDeveloperHub__DuplicateTransmitter(address)

ExternalDeveloperHub__ZeroAmount

error ExternalDeveloperHub__ZeroAmount()

ExternalDeveloperHub__ZeroOwner

error ExternalDeveloperHub__ZeroOwner()

ExternalDeveloperHub__ZeroAddress

error ExternalDeveloperHub__ZeroAddress()

ExternalDeveloperHub__InvalidAddress

error ExternalDeveloperHub__InvalidAddress(bytes)

ExternalDeveloperHub__NoTransmittersAllowed

error ExternalDeveloperHub__NoTransmittersAllowed()

ExternalDeveloperHub__InsufficientFunds

error ExternalDeveloperHub__InsufficientFunds()

ExternalDeveloperHub__InvalidConsensusTargetRate

error ExternalDeveloperHub__InvalidConsensusTargetRate(uint256)

ExternalDeveloperHub__ManualTransmittersLimitExceeded

error ExternalDeveloperHub__ManualTransmittersLimitExceeded()

ExternalDeveloperHub__MaxTransmittersLimitTooHigh

error ExternalDeveloperHub__MaxTransmittersLimitTooHigh()

ADMIN

bytes32 ADMIN

APPROVE

bytes32 APPROVE

BET_MANAGER

bytes32 BET_MANAGER

ROUND_MANAGER

bytes32 ROUND_MANAGER

ApproveExternalDeveloper

event ApproveExternalDeveloper(address externalDeveloper)

BanExternalDeveloper

event BanExternalDeveloper(address externalDeveloper)

SetMaxTransmitterLimitByAdmin

event SetMaxTransmitterLimitByAdmin(bytes32 protocolId, uint256 maxTransmitters)

SetMaxTransmitterLimit

event SetMaxTransmitterLimit(bytes32 protocolId, uint256 maxTransmitters)

SetMinProtocolBalance

event SetMinProtocolBalance(bytes32 protocolId, uint256 minProtocolBalance)

SetProtocolFee

event SetProtocolFee(bytes32 protocolId, uint256 minProtocolBalance)

RegisterProtocol

event RegisterProtocol(address owner, bytes32 _protocolId, uint256 _consensusTargetRate, uint256 _minDelegateAmount, uint256 _minPersonalAmount, uint256 _maxTransmitters, uint256 _msgBetAmount, uint256 _dataBetAmount, uint256 _firstMsgBetReward, uint256 _msgBetReward, uint256 _firstDataBetReward, uint256 _dataBetReward, address[] _transmitters)

SetProtocolOwner

event SetProtocolOwner(bytes32 protocolId, address owner)

SetDAOProtocolOwner

event SetDAOProtocolOwner(bytes32 protocolId, uint256 chainId, bytes owner)

Deposit

event Deposit(bytes32 protocolId, uint256 amount)

SetManualTransmitters

event SetManualTransmitters(bytes32 protocolId, address[] transmitters)

SetConsensusTargetRate

event SetConsensusTargetRate(bytes32 protocolId, uint256 rate)

SetMinDelegateAmount

event SetMinDelegateAmount(bytes32 protocolId, uint256 minDelegateAmount)

SetMinPersonalAmount

event SetMinPersonalAmount(bytes32 protocolId, uint256 minPersonalAmount)

AddAllowedProtocolAddress

event AddAllowedProtocolAddress(bytes32 protocolId, uint64 chainId, bytes protocolAddress)

RemoveAllowedProtocolAddress

event RemoveAllowedProtocolAddress(bytes32 protocolId, uint64 chainId, bytes protocolAddress)

AddAllowedProposerAddress

event AddAllowedProposerAddress(bytes32 protocolId, uint64 chainId, bytes proposerAddress)

RemoveAllowedProposerAddress

event RemoveAllowedProposerAddress(bytes32 protocolId, uint64 chainId, bytes proposerAddress)

AddExecutor

event AddExecutor(bytes32 protocolId, uint64 chainId, bytes executor)

RemoveExecutor

event RemoveExecutor(bytes32 protocolId, uint64 chainId, bytes executor)

ProtocolParams

struct ProtocolParams {
  uint256 msgBetAmount;
  uint256 dataBetAmount;
  uint256 msgBetReward;
  uint256 msgBetFirstReward;
  uint256 dataBetReward;
  uint256 dataBetFirstReward;
  uint256 consensusTargetRate;
}

ProtocolInfo

struct ProtocolInfo {
  address owner;
  uint256 fee;
  uint256 balance;
  uint256 maxTransmitters;
  uint256 minDelegateAmount;
  uint256 minPersonalAmount;
  address[] manualTransmitters;
}

isInit

bool isInit

setContracts init marker

approvedExternalDevelopers

mapping(address => bool) approvedExternalDevelopers

externalDevelopers that are KYB verified.

maxTransmittersLimitByAdmin

mapping(bytes32 => uint256) maxTransmittersLimitByAdmin

manual max transmitters limit

protocolInfo

mapping(bytes32 => struct ExternalDeveloperHub.ProtocolInfo) protocolInfo

activeParams

mapping(bytes32 => struct ExternalDeveloperHub.ProtocolParams) activeParams

Active params for current round.

realtimeParams

mapping(bytes32 => struct ExternalDeveloperHub.ProtocolParams) realtimeParams

Params that will be updated on next round turn.

protocols

bytes32[] protocols

protocol list

masterSmartContract

contract MasterSmartContract masterSmartContract

stakingManager

contract StakingManager stakingManager

ngl

contract IERC20 ngl

globalConfig

contract GlobalConfig globalConfig

minProtocolBalance

mapping(bytes32 => uint256) minProtocolBalance

Minimum balance in stake for specified protocol or it'll be paused

allowedChainIds

mapping(uint256 => bool) allowedChainIds

allowed chains

_protocolOwnerInternal

function _protocolOwnerInternal(bytes32 _protocolId) internal view

protocolOwner

modifier protocolOwner(bytes32 _protocolId)

allowedChainId

modifier allowedChainId(uint256 _chainId)

initialize

function initialize(address[2] initAddr) public

Initialize

Parameters

setContracts

function setContracts(address[6] initAddr) external

Set contracts addresses

Parameters

_authorizeUpgrade

function _authorizeUpgrade(address) internal

approveExternalDeveloper

function approveExternalDeveloper(address externalDeveloper) external

Approve externalDeveloper after KYB process

Parameters

banExternalDeveloper

function banExternalDeveloper(address externalDeveloper) external

Remove externalDeveloper from approved list

Parameters

setMaxTransmitterLimitByAdmin

function setMaxTransmitterLimitByAdmin(bytes32 _protocolId, uint256 _maxTransmitters) external

Change maximum allowed number of transmitters for protocol (enforced only on next param change by externalDeveloper)

Parameters

setMinProtocolBalance

function setMinProtocolBalance(bytes32 _protocolId, uint256 _minBalance) external

Change minimum balance for protocol

Parameters

setProtocolFee

function setProtocolFee(bytes32 _protocolId, uint256 _fee) external

Change change protocol fee for specified protocol

Parameters

getActiveProtocols

function getActiveProtocols() external view returns (bytes32[])

Protocols that have minimum balance and not paused

requireParamsValid

function requireParamsValid(bytes32 _protocolId) public view

Check if all protocol params are valid (should be called after each param setter)

Parameters

initGovProtocol

function initGovProtocol(address _owner, uint256 _minDelegateAmount, uint256 _minPersonalAmount, uint256 _maxTransmitters, struct ExternalDeveloperHub.ProtocolParams _protocolParams, address[] _transmitters) external

Gov protocol (added by Entangle) initialization

Parameters

addGovProtocolAddress

function addGovProtocolAddress(uint64 _chainId, bytes _govAddress, bytes[] _executors) external

set govProtocol address by admin (only once per deploy)

Parameters

registerProtocol

function registerProtocol(bytes32 _protocolId, address _owner, uint256 _minDelegateAmount, uint256 _minPersonalAmount, uint256 _maxTransmitters, struct ExternalDeveloperHub.ProtocolParams _protocolParams, address[] _transmitters) external

register new protocol (by externalDeveloper)

Parameters

deduceChangeParamsFee

function deduceChangeParamsFee() internal

Deduce fee from externalDeveloper on each function that changes protocol params

setProtocolOwner

function setProtocolOwner(bytes32 _protocolId, address newOwner) external

Transfer ownership to new externalDeveloper address

Parameters

setMinPersonalAmount

function setMinPersonalAmount(bytes32 _protocolId, uint256 _minPersonalAmount) external

Set minimum personal stake amount for transmitters that can participate in protocol

Parameters

setMinDelegateAmount

function setMinDelegateAmount(bytes32 _protocolId, uint256 _minDelegateAmount) external

Set minimum delegate amount for transmitters to participate in protocol

Parameters

setMaxTransmitterLimit

function setMaxTransmitterLimit(bytes32 _protocolId, uint256 _maxTransmitters) external

Set maximum number of transmitters that can participate in protocol

Parameters

setProtocolParams

function setProtocolParams(bytes32 _protocolId, struct ExternalDeveloperHub.ProtocolParams _protocolParams) external

Set protocol bet and reward params

Parameters

deposit

function deposit(bytes32 _protocolId, uint256 _amount) external

Deposit NGL to protocol balance

Parameters

setManualTransmitters

function setManualTransmitters(bytes32 _protocolId, address[] _transmitters) external

Set manual transmitter list

Parameters

addAllowedProtocolAddress

function addAllowedProtocolAddress(bytes32 _protocolId, uint64 _chainId, bytes _protocolAddress) external

Set protocol contract address

Parameters

removeAllowedProtocolAddress

function removeAllowedProtocolAddress(bytes32 _protocolId, uint64 _chainId, bytes _protocolAddress) external

Remove protocol contract address

Parameters

addAllowedProposerAddress

function addAllowedProposerAddress(bytes32 _protocolId, uint64 _chainId, bytes _proposerAddress) external

Set address that can propose new operations on EndPoint

Parameters

removeAllowedProposerAddress

function removeAllowedProposerAddress(bytes32 _protocolId, uint64 _chainId, bytes _proposerAddress) external

Remove address that can propose new operations on EndPoint

Parameters

addExecutor

function addExecutor(bytes32 _protocolId, uint64 _chainId, bytes _executor) external

Add executor address (which can call executeOperation on EndPoint with protocols operations)

Parameters

removeExecutor

function removeExecutor(bytes32 _protocolId, uint64 _chainId, bytes _executor) external

Remove executor address

Parameters

minDelegateAmount

function minDelegateAmount(bytes32 _protocolId) external view returns (uint256)

Minimum delegate amount for transmitters that can participate in protocol

Parameters

minPersonalAmount

function minPersonalAmount(bytes32 _protocolId) external view returns (uint256)

Minimum personal stake amount for transmitters that can participate in protocol

Parameters

maxTransmitters

function maxTransmitters(bytes32 _protocolId) external view returns (uint256)

Maximum number of transmitters that can participate in protocol

Parameters

protocolFee

function protocolFee(bytes32 _protocolId) external view returns (uint256)

Protocol fee deduced from protocol balance on each operation

Parameters

getMinProtocolBalance

function getMinProtocolBalance(bytes32 _protocolId) public view returns (uint256)

Get protocol min balance

Parameters

checkProtocolBalance

function checkProtocolBalance(bytes32 _protocolId) internal view returns (bool)

Check if protocol balance is above minimum of (global minProtocolBalance or protocol specific min balance)

Parameters

Return Values

betAmount

function betAmount(bytes32 _protocolId, enum BetManager.BetType betType) external view returns (uint256)

Get required bet amount for protocol for given bet type

Parameters

rewardAmount

function rewardAmount(bytes32 _protocolId, enum BetManager.BetType betType, bool first) external view returns (uint256)

Get reward amount credited to each participating transmitter after operation is executed

Parameters

getProtocolOwner

function getProtocolOwner(bytes32 _protocolId) external view returns (address)

Get protocol owner

Parameters

protocolBalance

function protocolBalance(bytes32 protocolId) external view returns (uint256)

Get current protocol balance

Parameters

manualTransmitters

function manualTransmitters(bytes32 protocolId) external view returns (address[])

Get list of transmitters added by externalDeveloper

Parameters

isManualTransmitter

function isManualTransmitter(bytes32 protocolId, address transmitter) external view returns (bool)

Check if transmitter is static and added by externalDeveloper

Parameters

getProtocols

function getProtocols() external view returns (bytes32[])

Get protocol list

turnRound

function turnRound() external

Update active params from realtime params for each protocol

deduceFee

function deduceFee(bytes32 _protocolId, uint256 _amount) external returns (bool)

Either deduce fee or pause protocol if no funds left

Parameters

Last updated