Skip to content

Commit

Permalink
feat(op-stack/forced-withdrawal): Explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
qbzzt committed Apr 5, 2023
1 parent 78a8331 commit f201762
Show file tree
Hide file tree
Showing 8 changed files with 28,243 additions and 0 deletions.
4 changes: 4 additions & 0 deletions op-stack/forced-withdrawal/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
L1URL=<<< L1 URL goes here >>>
L2URL=<<< L2 URL goes here >>>
PRIV_KEY=<< private key goes here >>>
OPTIMISM_PORTAL_ADDR=<< address of OptimismPortalProxy >>
11 changes: 11 additions & 0 deletions op-stack/forced-withdrawal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules

#Hardhat files
cache
artifacts

node_modules

#Hardhat files
cache
artifacts
23 changes: 23 additions & 0 deletions op-stack/forced-withdrawal/contracts/Greeter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

import "hardhat/console.sol";


contract Greeter {
string greeting;

constructor(string memory _greeting) {
console.log("Deploying a Greeter with greeting:", _greeting);
greeting = _greeting;
}

function greet() public view returns (string memory) {
return greeting;
}

function setGreeting(string memory _greeting) public {
console.log("Changing greeting from '%s' to '%s'", greeting, _greeting);
greeting = _greeting;
}
}
28 changes: 28 additions & 0 deletions op-stack/forced-withdrawal/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require("@nomiclabs/hardhat-waffle");
require('dotenv').config();

// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();

for (const account of accounts) {
console.log(account.address);
}
});

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.4",
networks: {
l1: {
url: process.env.L1URL,
accounts: [ process.env.PRIV_KEY ]
}
}
};
Loading

0 comments on commit f201762

Please sign in to comment.