Getting Started

Generating a Staking Contract

This guide will focus exclusively on sending a transaction to the currently recommended bepro router.

Generating a Staking Contract

Generating a Staking Contract basically resumes into the deployment of a new smart-contract or asserting an already created smart-contract to interact with it

๐Ÿšง

The variable contractAddress is necessary when using __assert if not being deployed prior

When using the function getStakingContract, the variable contractAddress is a defined Staking Contract.

This variable only needs to be present when already deployed, thus using the stakingContract.deploy() function.

If the contract was not deployed already, there is only the need to add the variable tokenAddress as the Token that will be Staking under this contract.

let app = new Application({test : true, mainnet : false});

let stakingContract = app.getStakingContract({tokenAddress : /* Token Address */});
                                              
/* Deploy */
let res = await stakingContract.deploy();
/* or Assert (if deployed already) */
await stakingContract.__assert();

console.log(stakingContract.getAddress()); // 0x23....a

๐Ÿ“˜

Always use __assert() after generating the StakingContract object (deployed already)

The __assert function has to always be called async after getStakingContract and not deploying it via the call deploy as a way to grab all relevant data async


Whatโ€™s Next