Skip to content

Solidity API โ€‹

๐Ÿ–Š๏ธ spSignWithMiner โ€‹

Service provider signature (needs to change the node's owner to a smart contract through the service provider's signature, otherwise the signature fails)

solidity
function spSignWithMiner() public onlySp
function spSignWithMiner() public onlySp

๐Ÿ’ฐ payOpsSecurityFund โ€‹

Service provider pays operation security deposit

Parameters:

  • id: Asset package ID
solidity
function payOpsSecurityFund(uint256 id) public payable onlySp
function payOpsSecurityFund(uint256 id) public payable onlySp

๐Ÿ’ฐ withdrawOpsSecurityFund โ€‹

Service provider withdraws operation security deposit

Parameters:

id: Asset package ID

solidity
function withdrawOpsSecurityFund(uint256 id) public onlySp
function withdrawOpsSecurityFund(uint256 id) public onlySp

๐Ÿ’ฐ spWithdraw โ€‹

Service provider withdraws earnings

Parameters:

id: Asset package ID

solidity
function spWithdraw(uint256 id) public onlySp
function spWithdraw(uint256 id) public onlySp

๐Ÿ› ๏ธ setMinerBackOwner โ€‹

Set the owner address that takes over the node after the fundraising plan expires

Parameters:

minerOwner: The address to which the smart contract transfers the owner's authority of the node

solidity
function setMinerBackOwner(bytes minerOwner) public
function setMinerBackOwner(bytes minerOwner) public

๐Ÿ’ฐ opsFundReward โ€‹

Returns the reward amount of the SP under the asset package

Parameters:

  • id: Asset package ID

Function returns:

TypeDescription
uint256SP's reward amount
solidity
function opsFundReward(uint256 id) public view returns (uint256)
function opsFundReward(uint256 id) public view returns (uint256)

๐Ÿ’ฐ spWillReleaseReward โ€‹

Get the number of unreleased earnings of the SP in the asset package

Parameters:

  • id: Asset package ID

Function returns:

TypeDescription
uint256Number of SP's unreleased earnings
solidity
function spWillReleaseReward(uint256 id) public view returns (uint256)
function spWillReleaseReward(uint256 id) public view returns (uint256)

๐Ÿ’ฐ spRewardAvailableLeft โ€‹

Get the number of SP's currently available earnings in the asset package

Parameters:

  • id: Asset package ID

Function returns:

TypeDescription
uint256Number of SP's available earnings
solidity
function spRewardAvailableLeft(uint256 id) public view returns (uint256 amountReturn)
function spRewardAvailableLeft(uint256 id) public view returns (uint256 amountReturn)

๐Ÿ” spFine โ€‹

Get the total fine generated during the operation of the SP under the asset package

Parameters:

  • key: Asset package ID

Function returns:

TypeDescription
uint256Total fine amount
solidity
function spFine(uint256 key) public view returns (uint256)
function spFine(uint256 key) public view returns (uint256)

๐Ÿ” spRewardLock โ€‹

Get the number of locked rewards of the SP under the asset package

Parameters:

  • key: Asset package ID

Function returns:

TypeDescription
uint256Number of SP's locked rewards
solidity
function spRewardLock(uint256 key) public view returns (uint256)
function spRewardLock(uint256 key) public view returns (uint256)

๐Ÿ” gotSpReward โ€‹

Get the number of rewards received by the SP under the asset package

Parameters:

  • key: Asset package ID

Function returns:

TypeDescription
uint256Number of SP's received rewards
solidity
function gotSpReward(uint256 key) public view returns (uint256)
function gotSpReward(uint256 key) public view returns (uint256)

๐Ÿ” opsCalcFund โ€‹

Get the number of security deposits of the SP under the asset package

Parameters:

  • key: Asset package ID

Function returns:

TypeDescription
uint256Number of SP's security deposits
solidity
function opsCalcFund(uint256 key) public view returns (uint256)
function opsCalcFund(uint256 key) public view returns (uint256)

๐Ÿ” opsSecurityFundRemain โ€‹

Get the remaining number of security deposits of the SP under the asset package

Parameters:

  • key: Asset package ID

Function returns:

TypeDescription
uint256Remaining number of SP's security deposits
solidity
function opsSecurityFundRemain(uint256 key) public view returns (uint256)
function opsSecurityFundRemain(uint256 key) public view returns (uint256)

footer message