Deploy and test scripts.

Added Rln token for testing.
This commit is contained in:
Keshav Gupta 2022-08-09 15:27:34 +02:00
parent c1e4e13857
commit 6f26811f26
No known key found for this signature in database
GPG Key ID: 42F874800B16699B
3 changed files with 37 additions and 0 deletions

11
contracts/TokenRln.sol Normal file
View File

@ -0,0 +1,11 @@
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract TokenRln is ERC20 {
constructor(uint256 initialSupply) public ERC20("TokenRln", "TRLN") {
_mint(msg.sender, initialSupply);
}
}

View File

@ -27,6 +27,19 @@ async function main() {
await rln.deployed();
console.log("Rln deployed to:", rln.address);
const Token = await ethers.getContractFactory("TokenRln");
const token = await Token.deploy(1000000000);
await token.deployed();
console.log("Rln token contract deployed to:", token.address);
const RlnErc20 = await ethers.getContractFactory("RLNERC20");
const rlnErc20 = await RlnErc20.deploy(10,20,poseidonHasher.address,token.address); //10 tokens as membership deposit
await rlnErc20.deployed();
console.log("RlnErc20 deployed to:", rlnErc20.address);
}
// We recommend this pattern to be able to use async/await everywhere

View File

@ -16,5 +16,18 @@ describe("Rln", function () {
await rln.deployed();
console.log("Rln deployed to:", rln.address);
const Token = await ethers.getContractFactory("TokenRln");
const token = await Token.deploy(1000000000);
await token.deployed();
console.log("Rln token contract deployed to:", token.address);
const RlnErc20 = await ethers.getContractFactory("RLNERC20");
const rlnErc20 = await RlnErc20.deploy(10,20,poseidonHasher.address,token.address); //10 tokens as membership deposit
await rlnErc20.deployed();
console.log("RlnErc20 deployed to:", rlnErc20.address);
});
});