DAO Claim Tutorial
This tutorial helps anyone release tokens to the Blockswap DAO that are the vesting contracts. There are 5 years of vesting contracts. The remaining contracts that are active are as follows:
- Year 3: 0xb21c8636773C84b9B15FC5986E55D381bD0deAAE
- Year 4: 0xCba026594B96E27363C7f713Df6AcfF821e39ee7
- Year 5: 0x9fB5EB5c0befEa804D2b942436Dd1C05Dc3Cc1ee
Anyone can call the claim function on the vesting contracts which will release more tokens into the DAO treasury as they are unlocking linearly on a block by block basis
You can call the claim function on the vesting contracts as follows:
Using Etherscan
Clicking on the the above vesting contract addresses will take you to the contracts on etherscan. Click on the Contract
tab. Then click on the Write as Proxy
tab. You should now be able to see the claim
function as the very first method in the list. Click on that, then click on the Write
button to initiate the transaction.
NOTE: Calling the claim function from Etherscan can be a bit unreliable sometimes, so using the script is recommended.
Using a script
Install required dependencies
Please install the required dependencies by running the following in your termninal
npm i ethers
Importing the libraries
const {ethers} = require("ethers");
Creating a signer instance
It is recommended to use ethers library to create a provider and a signer instance, required for signing the transaction. You can use any provider API that you want from this list. For this tutorial, Infura is used.
const provider = new ethers.InfuraProvider(
"mainnet",
YOUR_INFURA_PROJECT_ID,
YOUR_INFURA_PROJECT_SECRET
);
const signer = new ethers.Wallet(YOUR_PRIVATE_KEY, provider);
Creating a contract instance
Using ethers, we can create an instance of the active vesting contract as follows
const abi = [{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"}];
const contract = new ethers.Contract(
VESTING_CONTRACT_ADDRESS,
abi,
signer
);
Calling the claim function
Using the contract instance we can simply call the claim function.
const tx = await contract.claim();
console.log(tx)
Script
const {ethers} = require("ethers");
const provider = new ethers.InfuraProvider(
"mainnet",
YOUR_INFURA_PROJECT_ID,
YOUR_INFURA_PROJECT_SECRET
);
const signer = new ethers.Wallet(YOUR_PRIVATE_KEY, provider);
const abi = [{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"}];
const contract = new ethers.Contract(
VESTING_CONTRACT_ADDRESS,
abi,
signer
);
const tx = await contract.claim();
console.log(tx)