Skip to content

Commit

Permalink
add another test and simplify constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Dec 17, 2024
1 parent f0580bc commit 0a988d5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
7 changes: 3 additions & 4 deletions contracts/contracts/token/WOETH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ contract WOETH is ERC4626, Governable, Initializable {
uint256 public oethCreditsHighres;
bool private _oethCreditsInitialized;

// no need to set ERC20 name and symbol since they are overridden in WOETH & WOETHBase
constructor(
ERC20 underlying_,
string memory name_,
string memory symbol_
) ERC20(name_, symbol_) ERC4626(underlying_) Governable() {}
ERC20 underlying_
) ERC20("", "") ERC4626(underlying_) Governable() {}

/**
* @notice Enable OETH rebasing for this contract
Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/token/WOETHBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract WOETHBase is WOETH {
constructor(ERC20 underlying_)
WOETH(underlying_, "Wrapped Super OETH", "wsuperOETHb")
WOETH(underlying_)
{}

function name() public view virtual override returns (string memory) {
Expand Down
4 changes: 1 addition & 3 deletions contracts/deploy/mainnet/112_upgrade_woeth.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ module.exports = deploymentWithGovernanceProposal(
const cWOETHProxy = await ethers.getContract("WOETHProxy");

const dWOETHImpl = await deployWithConfirmation("WOETH", [
cOETHProxy.address,
"Wrapped OETH",
"WOETH",
cOETHProxy.address
]);

const cWOETH = await ethers.getContractAt("WOETH", cWOETHProxy.address);
Expand Down
7 changes: 7 additions & 0 deletions contracts/test/token/woeth.mainnet.fork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ describe("ForkTest: wOETH", function () {
fixture = await loadFixture();
});

it("Should have correct name and symbol", async () => {
const { woeth } = fixture;

expect(await woeth.name()).to.equal("Wrapped OETH");
expect(await woeth.symbol()).to.equal("wOETH");
});

it("Should prevent total asset manipulation by donations", async () => {
const { oeth, woeth, domen } = fixture;
const totalAssetsBefore = await woeth.totalAssets();
Expand Down

0 comments on commit 0a988d5

Please sign in to comment.