Skip to content

Commit

Permalink
adjusting the TestERC20 contract and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
count-sum committed Oct 23, 2024
1 parent a65d3da commit 231f271
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 46 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ deploy-l1-test-erc20:
TEST_ERC20_NAME=TestERC20 \
TEST_ERC20_SYMBOL=TERC20 \
TEST_ERC20_INITIAL_SUPPLY=100000 \
TEST_ERC20_MINT_RECEIVER=0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 \
npx hardhat deploy --network zkevm_dev --tags TestERC20

deploy-l2-test-erc20:
Expand All @@ -132,7 +131,6 @@ deploy-l2-test-erc20:
TEST_ERC20_NAME=TestERC20 \
TEST_ERC20_SYMBOL=TERC20 \
TEST_ERC20_INITIAL_SUPPLY=100000 \
TEST_ERC20_MINT_RECEIVER=0xe00cad48944330a60bbaedfbf2e0ac97e9762a1e \
npx hardhat deploy --network zkevm_dev --tags TestERC20

upgrade-linea-rollup-on-uat:
Expand Down
6 changes: 3 additions & 3 deletions contracts/contracts/tokenBridge/mocks/TestERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ contract TestERC20 is ERC20, Ownable {
* @dev Constructor that gives msg.sender all of existing tokens.
*/

constructor(string memory _name, string memory _symbol, uint256 _initialSupply, address _mintReceiver) ERC20(_name, _symbol) {
_mint(_mintReceiver, _initialSupply);
constructor(string memory _name, string memory _symbol, uint256 _initialSupply) ERC20(_name, _symbol) {
_mint(msg.sender, _initialSupply);
}

/**
Expand All @@ -25,7 +25,7 @@ contract TestERC20 is ERC20, Ownable {
* @param _amount The amount of tokens to mint.
*/

function mint(address _to, uint256 _amount) public onlyOwner {
function mint(address _to, uint256 _amount) public {
_mint(_to, _amount);
}

Expand Down
8 changes: 1 addition & 7 deletions contracts/deploy/11_deploy_TestERC20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const tokenName = getRequiredEnvVar("TEST_ERC20_NAME");
const tokenSymbol = getRequiredEnvVar("TEST_ERC20_SYMBOL");
const initialSupply = getRequiredEnvVar("TEST_ERC20_INITIAL_SUPPLY");
const mintReceiver = getRequiredEnvVar("TEST_ERC20_MINT_RECEIVER");

if (!existingContractAddress) {
console.log(`Deploying initial version, NB: the address will be saved if env SAVE_ADDRESS=true.`);
Expand All @@ -28,12 +27,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
}

const TestERC20Factory = await ethers.getContractFactory(contractName);
const contract = await TestERC20Factory.deploy(
tokenName,
tokenSymbol,
ethers.parseEther(initialSupply),
mintReceiver,
);
const contract = await TestERC20Factory.deploy(tokenName, tokenSymbol, ethers.parseEther(initialSupply));

await contract.waitForDeployment();
const contractAddress = await contract.getAddress();
Expand Down
Loading

0 comments on commit 231f271

Please sign in to comment.