Skip to main content

OracleNodeStaking

Masa Finance

OracleNodeStaking

This contract is used for staking tokens in the Oracle Node

The contract inherits from ReentrancyGuard to prevent re-entrancy attacks

Methods

balanceOf

function balanceOf(address account) external view returns (uint256)

Function to check the balance of a particular account

This is called by the oracle node to check isStaked status

Parameters

NameTypeDescription
accountaddressThe address of the account to be checked

Returns

NameTypeDescription
_0uint256The balance of the account

masaToken

function masaToken() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

minimumStake

function minimumStake() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

stake

function stake(uint256 amount) external payable

Function to stake tokens

It updates the stake, transfers the tokens to the contract, mints the token representing the stake, and emits the Staked event

Parameters

NameTypeDescription
amountuint256The amount of tokens to be staked

stakes

function stakes(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

withdraw

function withdraw(uint256 amount) external nonpayable

Parameters

NameTypeDescription
amountuint256The amount of tokens to be withdrawn

Events

Staked

event Staked(address indexed user, uint256 amount)

Parameters

NameTypeDescription
user indexedaddressundefined
amountuint256undefined

Withdrawn

event Withdrawn(address indexed user, uint256 amount)

Parameters

NameTypeDescription
user indexedaddressundefined
amountuint256undefined