diff --git a/contracts/TokenRln.sol b/contracts/TokenRln.sol new file mode 100644 index 0000000..c1b170a --- /dev/null +++ b/contracts/TokenRln.sol @@ -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); + } +} \ No newline at end of file diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 9221b13..8a02144 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -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 diff --git a/test/index.ts b/test/index.ts index a95ea34..a7686bc 100644 --- a/test/index.ts +++ b/test/index.ts @@ -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); }); });