generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:toknowwhy/theunit-contracts
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.21 <0.9.0; | ||
|
||
import { BaseScript } from "./Base.s.sol"; | ||
import { TestCollateral } from "../src/test/TestCollateral.sol"; | ||
import { TicketFactory } from "../src/core/TicketFactory.sol"; | ||
import { console2 } from "forge-std/console2.sol"; | ||
|
||
contract DeployMintTestCollateral is BaseScript { | ||
function run(address to, uint256 amount) public broadcast returns (bool) { | ||
|
||
TestCollateral collateral = new TestCollateral(broadcaster); | ||
console2.log("Test Collateral deployed at: ", address(collateral)); | ||
collateral.mint(to, amount * 1e18); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.21; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol"; | ||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; | ||
|
||
contract TestCollateral is ERC20, ERC20Burnable, ERC20Pausable, Ownable, ERC20Permit { | ||
constructor(address initialOwner) | ||
ERC20("TestCollateral", "TCOL") | ||
Ownable(initialOwner) | ||
ERC20Permit("TestCollateral") | ||
{} | ||
|
||
function pause() public onlyOwner { | ||
_pause(); | ||
} | ||
|
||
function unpause() public onlyOwner { | ||
_unpause(); | ||
} | ||
|
||
function mint(address to, uint256 amount) public onlyOwner { | ||
_mint(to, amount); | ||
} | ||
|
||
// The following functions are overrides required by Solidity. | ||
|
||
function _update(address from, address to, uint256 value) | ||
internal | ||
override(ERC20, ERC20Pausable) | ||
{ | ||
super._update(from, to, value); | ||
} | ||
} |