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 KYC 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

NameTypeDescription

initAddr

address[2]

setContracts

function setContracts(address[6] initAddr) external

Set contracts addresses

Parameters

NameTypeDescription

initAddr

address[6]

_authorizeUpgrade

function _authorizeUpgrade(address) internal

approveExternalDeveloper

function approveExternalDeveloper(address externalDeveloper) external

Approve externalDeveloper after KYC process

Parameters

NameTypeDescription

externalDeveloper

address

- ExternalDeveloper management address

banExternalDeveloper

function banExternalDeveloper(address externalDeveloper) external

Remove externalDeveloper from approved list

Parameters

NameTypeDescription

externalDeveloper

address

- ExternalDeveloper management address

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

NameTypeDescription

_protocolId

bytes32

- Protocol id

_maxTransmitters

uint256

- Maximum allowed transmitters for protocol

setMinProtocolBalance

function setMinProtocolBalance(bytes32 _protocolId, uint256 _minBalance) external

Change minimum balance for protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_minBalance

uint256

- Minimum balance

setProtocolFee

function setProtocolFee(bytes32 _protocolId, uint256 _fee) external

Change change protocol fee for specified protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_fee

uint256

- New protocol fee

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

NameTypeDescription

_protocolId

bytes32

- Protocol id

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

NameTypeDescription

_owner

address

_minDelegateAmount

uint256

- Minimum delegate amount for transmitters to participate in protocol

_minPersonalAmount

uint256

- Minimum personal stake amount for transmitters that can participate in protocol

_maxTransmitters

uint256

- Maximum number of transmitters that can participate in protocol

_protocolParams

struct ExternalDeveloperHub.ProtocolParams

- Protocol params

_transmitters

address[]

- List of manual transmitters

addGovProtocolAddress

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

set govProtocol address by admin (only once per deploy)

Parameters

NameTypeDescription

_chainId

uint64

_govAddress

bytes

- Gov protocol address

_executors

bytes[]

- List of executors

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

NameTypeDescription

_protocolId

bytes32

- Protocol id

_owner

address

- Protocol owner address

_minDelegateAmount

uint256

- Minimum delegate amount for transmitters to participate in protocol

_minPersonalAmount

uint256

- Minimum personal stake amount for transmitters that can participate in protocol

_maxTransmitters

uint256

- Maximum number of transmitters that can participate in protocol

_protocolParams

struct ExternalDeveloperHub.ProtocolParams

- Protocol params

_transmitters

address[]

- List of manual transmitters

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

NameTypeDescription

_protocolId

bytes32

- Protocol id

newOwner

address

- New owner address

setMinPersonalAmount

function setMinPersonalAmount(bytes32 _protocolId, uint256 _minPersonalAmount) external

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

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_minPersonalAmount

uint256

- Minimum personal stake amount

setMinDelegateAmount

function setMinDelegateAmount(bytes32 _protocolId, uint256 _minDelegateAmount) external

Set minimum delegate amount for transmitters to participate in protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_minDelegateAmount

uint256

- Minimum delegate amount

setMaxTransmitterLimit

function setMaxTransmitterLimit(bytes32 _protocolId, uint256 _maxTransmitters) external

Set maximum number of transmitters that can participate in protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_maxTransmitters

uint256

- Maximum number of transmitters

setProtocolParams

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

Set protocol bet and reward params

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_protocolParams

struct ExternalDeveloperHub.ProtocolParams

- Protocol params

deposit

function deposit(bytes32 _protocolId, uint256 _amount) external

Deposit NGL to protocol balance

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_amount

uint256

- Amount of NGL to deposit

setManualTransmitters

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

Set manual transmitter list

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_transmitters

address[]

- List of transmitter addresses

addAllowedProtocolAddress

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

Set protocol contract address

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_chainId

uint64

- Chain id

_protocolAddress

bytes

- Protocol address

removeAllowedProtocolAddress

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

Remove protocol contract address

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_chainId

uint64

- Chain id

_protocolAddress

bytes

- Protocol address

addAllowedProposerAddress

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

Set address that can propose new operations on EndPoint

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_chainId

uint64

_proposerAddress

bytes

- Address that can propose new operations

removeAllowedProposerAddress

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

Remove address that can propose new operations on EndPoint

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_chainId

uint64

- Chain id

_proposerAddress

bytes

- Address that can propose new operations

addExecutor

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

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

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_chainId

uint64

- Chain id

_executor

bytes

- Executor address

removeExecutor

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

Remove executor address

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

_chainId

uint64

- Chain id

_executor

bytes

- Executor address

minDelegateAmount

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

Minimum delegate amount for transmitters that can participate in protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

minPersonalAmount

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

Minimum personal stake amount for transmitters that can participate in protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

maxTransmitters

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

Maximum number of transmitters that can participate in protocol

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

protocolFee

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

Protocol fee deduced from protocol balance on each operation

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

getMinProtocolBalance

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

Get protocol min balance

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

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

NameTypeDescription

_protocolId

bytes32

Protocol id

Return Values

NameTypeDescription

[0]

bool

bool True if protocol balance is above minimum

betAmount

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

Get required bet amount for protocol for given bet type

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

betType

enum BetManager.BetType

- BetType (Message or Data)

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

NameTypeDescription

_protocolId

bytes32

- Protocol id

betType

enum BetManager.BetType

- BetType (Message or Data)

first

bool

- First bet

getProtocolOwner

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

Get protocol owner

Parameters

NameTypeDescription

_protocolId

bytes32

- Protocol id

protocolBalance

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

Get current protocol balance

Parameters

NameTypeDescription

protocolId

bytes32

- Protocol id

manualTransmitters

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

Get list of transmitters added by externalDeveloper

Parameters

NameTypeDescription

protocolId

bytes32

- Protocol id

isManualTransmitter

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

Check if transmitter is static and added by externalDeveloper

Parameters

NameTypeDescription

protocolId

bytes32

- Protocol id

transmitter

address

- Transmitter address

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

NameTypeDescription

_protocolId

bytes32

- Protocol id

_amount

uint256

- Amount of NGL to deduce

Last updated