Class

NetworkFactory

NetworkFactory(options)

Constructor

# new NetworkFactory(options)

NetworkFactory Object

Parameters:
Name Type Description
options NetworkFactory~Options

View Source models/BEPRO/NetworkFactory.js, line 18

Methods

# __assert() → {Promise.<void>}

Asserts the 2 ERC20Contract on the current address

View Source models/BEPRO/NetworkFactory.js, line 34

Contract is not deployed, first deploy it and provide a contract address

Error
Promise.<void>

# approveSettlerERC20Token() → {Promise.<number>}

Approve ERC20 Allowance

View Source models/BEPRO/NetworkFactory.js, line 182

Promise.<number>

# createNetwork(params) → {Promise.<TransactionObject>}

Create Network

Parameters:
Name Type Description
params Object
settlerToken Address
transactionalToken Address

View Source models/BEPRO/NetworkFactory.js, line 244

Promise.<TransactionObject>

# deploy(params, options) → {Promise.<(*|undefined)>}

Deploys Contracts

Parameters:
Name Type Description
params Object
beproAddress string
options IContract~TxOptions

View Source models/BEPRO/NetworkFactory.js, line 260

Promise.<(*|undefined)>

# async getAmountofNetworksForked() → {Promise.<number>}

Get Amount of Networks Forked in the Protocol

View Source models/BEPRO/NetworkFactory.js, line 82

Promise.<number>

# async getBEPROLocked() → {Promise.<number>}

Get Total Amount of Tokens Staked in the Protocol

View Source models/BEPRO/NetworkFactory.js, line 124

Promise.<number>

# async getLockedStakedByAddress(address) → {Promise.<number>}

Get Total Amount of Tokens Locked by Operator in the Network

Parameters:
Name Type Description
address Address

View Source models/BEPRO/NetworkFactory.js, line 95

Promise.<number>

# getNetworkByAddress(address) → {Adddress}

Get Network By Creator Address

Parameters:
Name Type Description
address Address

View Source models/BEPRO/NetworkFactory.js, line 61

Adddress

# getNetworkById(id) → {Adddress}

Get Network By Id

Parameters:
Name Type Description
id number

View Source models/BEPRO/NetworkFactory.js, line 72

Adddress

# getNetworks(address) → {Array.<Address>}

Get Open Issues Available

Parameters:
Name Type Description
address Address

View Source models/BEPRO/NetworkFactory.js, line 114

Array.<Address>

# getSettlerTokenAddress() → {Promise.<address>}

Get Settler Token Address

View Source models/BEPRO/NetworkFactory.js, line 152

Promise.<address>

# getSettlerTokenContract()

View Source models/BEPRO/NetworkFactory.js, line 273

ERC20Contract|null

# isApprovedSettlerToken(params) → {Promise.<number>}

Verify if Approved

Parameters:
Name Type Description
params Object
amount number
address Address

View Source models/BEPRO/NetworkFactory.js, line 198

Promise.<number>

# async isOperator(params) → {Promise.<address>}

Verify if Address is Council

Parameters:
Name Type Description
params Object
address number

View Source models/BEPRO/NetworkFactory.js, line 144

Promise.<address>

# lock(params) → {Promise.<TransactionObject>}

lock tokens for operator use

Parameters:
Name Type Description
params Object

View Source models/BEPRO/NetworkFactory.js, line 212

Tokens Amount has to be higher than 0

Error

Tokens not approve for tx, first use 'approveERC20'

Error
Promise.<TransactionObject>

# async OPERATOR_AMOUNT() → {Promise.<Integer>}

Get Amount Needed for Operator

View Source models/BEPRO/NetworkFactory.js, line 168

Promise.<Integer>

# unlock() → {Promise.<TransactionObject>}

Unlock Tokens for oracles

View Source models/BEPRO/NetworkFactory.js, line 230

Tokens Amount has to be higher than 0

Error
Promise.<TransactionObject>

Type Definitions

Object

# Options

Properties:
Name Type Attributes Default Description
test Boolean
localtest Boolean

ganache local blockchain

web3Connection Web3Connection <optional>
Web3Connection

created from params: 'test', 'localtest' and optional 'web3Connection' string and 'privateKey'

contractAddress string <optional>

View Source models/BEPRO/NetworkFactory.js, line 10