Skip to content

Commit

Permalink
Add burn sugar method to WOETH on L2 (#2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Mar 21, 2024
1 parent 6f54e6b commit e62e925
Show file tree
Hide file tree
Showing 20 changed files with 388 additions and 1,108 deletions.
8 changes: 8 additions & 0 deletions contracts/contracts/token/BridgedWOETH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ contract BridgedWOETH is
_burn(account, amount);
}

/**
* @dev Burns tokens from `msg.sender`
* @param amount Amount of tokens to burn
*/
function burn(uint256 amount) external onlyRole(BURNER_ROLE) nonReentrant {
_burn(msg.sender, amount);
}

/**
* @dev Returns the name of the token.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/001_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ const main = async () => {

main.id = "001_core";
main.dependencies = ["mocks"];
main.tags = ["unit_tests"];
main.tags = ["unit_tests", "arb_unit_tests"];
main.skip = () => isFork;

module.exports = main;
28 changes: 28 additions & 0 deletions contracts/deploy/088_upgrade_woeth_on_arb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { isFork } = require("../test/helpers");
const { deployOnArb } = require("../utils/delpoy-l2");
const { deployWithConfirmation } = require("../utils/deploy");
const { impersonateAndFund } = require("../utils/signers");

module.exports = deployOnArb(
{
deployName: "088_upgrade_woeth_on_arb",
},
async ({ ethers }) => {
const cWOETHProxy = await ethers.getContract("BridgedWOETHProxy");

// Deploy Bridged WOETH Token implementation
await deployWithConfirmation("BridgedWOETH", []);

const cWOETHImpl = await ethers.getContract("BridgedWOETH");
console.log("BridgedWOETH address:", cWOETHImpl.address);

if (isFork) {
console.log("Simulating upgrade on fork");

const governorAddr = await cWOETHProxy.governor();
const sGovernor = await impersonateAndFund(governorAddr);

await cWOETHProxy.connect(sGovernor).upgradeTo(cWOETHImpl.address);
}
}
);
1 change: 0 additions & 1 deletion contracts/deployments/arbitrum/.chainId

This file was deleted.

3 changes: 0 additions & 3 deletions contracts/deployments/arbitrum/.migrations.json

This file was deleted.

Loading

0 comments on commit e62e925

Please sign in to comment.