// apply a new masternode candidate
function propose(address _candidate) external payable;
// Deposit to stake/vote for a candidate
function vote(address _candidate) external payable;
// Unstake/unvote for a candidate
function unvote(address _candidate, uint256 _cap) public;
// Resign a candidate
function resign(address _candidate) public;
// Withdraw after unvote, resign
function withdraw(uint256 _blockNumber, uint _index) public;
function getCandidates() public view returns(address[]);
function getCandidateCap(address _candidate) public view returns(uint256);
function getCandidateOwner(address _candidate) public view returns(address);
function getVoterCap(address _candidate, address _voter) public view returns(uint256);
function getVoters(address _candidate) public view returns(address[]);
function isCandidate(address _candidate) public view returns(bool);
function getWithdrawBlockNumbers() public view returns(uint256[]);
function getWithdrawCap(uint256 _blockNumber) public view returns(uint256);
Viction provides RPC APIs that can be used with Web3 library to directly call the functions in the smart contract.
You can follow the steps below to interact with the smart contract by using Web3 library and NodeJS.
Init Web3 Provider
At the first step, you need init Web3 provider by connecting Viction Fullnode RPC endpoint.
Masternode owners need to have at least 50,000 VIC to apply to become a Masternode Candidate. Make sure to have > 50,000 VIC in the Masternode owner wallet in order to deposit it into the smart contract and pay the related transaction fee.
Apply to become a Masternode Candidate by calling propose function from the smart contract