Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions contracts/script/deploy/xYield/DeployMintableERC20.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.30;

import { MintableERC20 } from "../../../src/xYield/MintableERC20.sol";
import { DeploymentUtils } from "../../lib/DeploymentUtils.sol";

contract DeployMintableERC20 is DeploymentUtils {
MintableERC20 private token;

function deploy() external {
selectMainnetOrSepoliaFork("base");
startBroadcastWithDeployerKeyIfItExists();

token = new MintableERC20(address(0x6c8E1d54297aAe7C34f1F5cF73559e621a394eFb), "xyUSDC", "xyUSDC");

vm.stopBroadcast();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.30;

import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract XyieldToken is ERC20 {
contract MintableERC20 is ERC20 {
address public minter;

/// @notice Emitted when the address authorized to mint is updated.
Expand All @@ -23,6 +23,12 @@ contract XyieldToken is ERC20 {
minter = _minter;
}

/// @notice Returns the number of decimals used to get its user representation
/// @return The number of decimals
function decimals() public pure override returns (uint8) {
return 6;
}

modifier onlyMinter() {
if (msg.sender != minter) revert NotAuthorized();
_;
Expand Down