Constructor
# new NetworkFactory(options)
NetworkFactory Object
Parameters:
Name | Type | Description |
---|---|---|
options |
NetworkFactory~Options
|
Methods
# __assert() → {Promise.<void>}
Asserts the 2 ERC20Contract on the current address
Contract is not deployed, first deploy it and provide a contract address
Error
Promise.<void>
# createNetwork(params) → {Promise.<TransactionObject>}
Create Network
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
settlerToken |
Address
|
|
transactionalToken |
Address
|
Promise.<TransactionObject>
# deploy(params, options) → {Promise.<(*|undefined)>}
Deploys Contracts
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
beproAddress |
string
|
|
options |
IContract~TxOptions
|
Promise.<(*|undefined)>
# async getAmountofNetworksForked() → {Promise.<number>}
Get Amount of Networks Forked in the Protocol
Promise.<number>
# async getBEPROLocked() → {Promise.<number>}
Get Total Amount of Tokens Staked in the Protocol
Promise.<number>
# async getLockedStakedByAddress(address) → {Promise.<number>}
Get Total Amount of Tokens Locked by Operator in the Network
Parameters:
Name | Type | Description |
---|---|---|
address |
Address
|
Promise.<number>
# getNetworkByAddress(address) → {Adddress}
Get Network By Creator Address
Parameters:
Name | Type | Description |
---|---|---|
address |
Address
|
Adddress
# getNetworkById(id) → {Adddress}
Get Network By Id
Parameters:
Name | Type | Description |
---|---|---|
id |
number
|
Adddress
# getNetworks(address) → {Array.<Address>}
Get Open Issues Available
Parameters:
Name | Type | Description |
---|---|---|
address |
Address
|
Array.<Address>
# isApprovedSettlerToken(params) → {Promise.<number>}
Verify if Approved
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
amount |
number
|
|
address |
Address
|
Promise.<number>
# async isOperator(params) → {Promise.<address>}
Verify if Address is Council
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
address |
number
|
Promise.<address>
# lock(params) → {Promise.<TransactionObject>}
lock tokens for operator use
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
Tokens Amount has to be higher than 0
Error
Tokens not approve for tx, first use 'approveERC20'
Error
Promise.<TransactionObject>
# unlock() → {Promise.<TransactionObject>}
Unlock Tokens for oracles
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> |