To the run the contract make sure you have:
Now run the command npm install
. It'll install all the dependecies like truffle and it's helping libraries. After this there are few things that needs to be done:
- Create an account on Infura
- Start a project and get the endpoint to connect to Kovan testnet.
- Setup a Mnemonic as well that will get the account
Make sure to have some Ethers on your Kovan testnet account to carry out the transactions
-
truffle migrate --network kovan This will deploy the contract on the network
-
truffle console We can now access and use the contract
-
const contract= await MyContract.deployed()
-
await contract.deposit()
-
const interest_earned= await contract.withdrawi()
This way you can use the contract.