parent
c1e4e13857
commit
6f26811f26
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,6 +27,19 @@ async function main() {
|
||||||
await rln.deployed();
|
await rln.deployed();
|
||||||
|
|
||||||
console.log("Rln deployed to:", rln.address);
|
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
|
// We recommend this pattern to be able to use async/await everywhere
|
||||||
|
|
|
@ -16,5 +16,18 @@ describe("Rln", function () {
|
||||||
await rln.deployed();
|
await rln.deployed();
|
||||||
|
|
||||||
console.log("Rln deployed to:", rln.address);
|
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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue