Skip to content

Commit

Permalink
remove 1.1 and merge changes into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
snggeng committed Jun 5, 2024
1 parent a91335c commit 1c1f8c0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 85 deletions.
16 changes: 0 additions & 16 deletions src/v1.1/FiatTokenV1_1.sol

This file was deleted.

6 changes: 5 additions & 1 deletion src/v1/FiatTokenV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ contract FiatTokenV1 is
}

function version() public pure virtual returns (string memory) {
return "v1";
return "1";
}

function decimals() public pure virtual override(ERC20Upgradeable) returns (uint8) {
return 6;
}

function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADER_ROLE) {}
Expand Down
62 changes: 0 additions & 62 deletions test/v1.1/FiatTokenV1_1.t.sol

This file was deleted.

12 changes: 6 additions & 6 deletions test/v1/FiatTokenV1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {Ramen} from "../../src/mocks/Ramen.sol";
contract FiatTokenV99 is FiatTokenV1 {
// solhint-disable-next-line foundry-test-functions
function version() public pure virtual override(FiatTokenV1) returns (string memory) {
return "v99";
return "99";
}
}

Expand Down Expand Up @@ -98,7 +98,7 @@ contract FiatTokenV1Test is Test {
// ERC 20 behavior

function testVersion() public {
assertEq(fiatTokenV1.version(), "v1");
assertEq(fiatTokenV1.version(), "1");
}

function testName() public {
Expand All @@ -110,7 +110,7 @@ contract FiatTokenV1Test is Test {
}

function testDecimals() public {
assertEq(fiatTokenV1.decimals(), 18);
assertEq(fiatTokenV1.decimals(), 6);
}

function testBalanceOf() public {
Expand Down Expand Up @@ -503,16 +503,16 @@ contract FiatTokenV1Test is Test {
// new implementation contract
FiatTokenV99 fiatTokenV99 = new FiatTokenV99();
address newImplementationAddress = address(fiatTokenV99);
assertEq(fiatTokenV99.version(), "v99");
assertEq(fiatTokenV1.version(), "v1");
assertEq(fiatTokenV99.version(), "99");
assertEq(fiatTokenV1.version(), "1");
// upgrade contract
vm.prank(upgrader);
fiatTokenV1.upgradeToAndCall(newImplementationAddress, "");
address updatedImplementationAddress = Upgrades.getImplementationAddress(address(proxy));
// verify implementation address is updated
assertEq(newImplementationAddress, updatedImplementationAddress);
// verify version() function implementation is updated
assertEq(fiatTokenV1.version(), "v99");
assertEq(fiatTokenV1.version(), "99");
}

// Trusted addresses
Expand Down

0 comments on commit 1c1f8c0

Please sign in to comment.