-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
93 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn prettier | ||
yarn compile | ||
yarn lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import "@nomiclabs/hardhat-ethers"; | ||
import hre from "hardhat"; | ||
|
||
async function main() { | ||
const accounts = await hre.ethers.getSigners(); | ||
|
||
for (const account of accounts) { | ||
console.log(await account.getAddress()); | ||
} | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { CoinbaseResolver__factory } from "../../src/types"; | ||
import "@nomiclabs/hardhat-ethers"; | ||
import hre from "hardhat"; | ||
|
||
async function main() { | ||
const { ethers } = hre; | ||
|
||
const deployer = (await ethers.getSigners())[0]; | ||
|
||
const resolverFactory = await ethers.getContractFactory("CoinbaseResolver"); | ||
const proxyFactory = await ethers.getContractFactory("ERC1967Proxy"); | ||
|
||
console.log("deploying implementation contract..."); | ||
const implementation = await resolverFactory.deploy(); | ||
await implementation.deployed(); | ||
console.log("-> deployed implementation contract at", implementation.address); | ||
|
||
console.log("initializing implementation contract with dummy values..."); | ||
await implementation.initialize(ethers.constants.AddressZero, "", []); | ||
console.log("-> initialized implementation contract"); | ||
|
||
const iCoinbaseResolver = CoinbaseResolver__factory.createInterface(); | ||
|
||
const proxyArgs = [ | ||
implementation.address, | ||
iCoinbaseResolver.encodeFunctionData("initialize", [ | ||
deployer.address, | ||
"http://localhost:3000/r/{sender}/{data}", | ||
[deployer.address], | ||
]), | ||
]; | ||
|
||
console.log( | ||
`deploying proxy contract (arguments: ${JSON.stringify(proxyArgs)})...` | ||
); | ||
const proxy = await proxyFactory.deploy( | ||
implementation.address, | ||
iCoinbaseResolver.encodeFunctionData("initialize", [ | ||
deployer.address, | ||
"http://localhost:3000/r/{sender}/{data}", | ||
[deployer.address], | ||
]) | ||
); | ||
await proxy.deployed(); | ||
console.log("-> deployed proxy contract at", proxy.address); | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.