-
Notifications
You must be signed in to change notification settings - Fork 45
Raise transfer stipend #672
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ export default { | |
}, | ||
networks: { | ||
hardhat: { | ||
hardfork: "berlin", | ||
blockGasLimit: 12.5e6, | ||
}, | ||
mainnet: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import GnosisSafe from "@gnosis.pm/safe-contracts/build/artifacts/contracts/GnosisSafe.sol/GnosisSafe.json"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Mentioned in the PR description ... Everything looks good There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: you could pull the ABI from https://github.com/gnosis/safe-deployments but we are currently missing the deployment code in the deployments which might be interesting for tests ... I opened an issue for this: safe-global/safe-deployments#8 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit: was not even aware that we include the hardhat build artifacts in the npm release 😬 |
||
import CompatibilityFallbackHandler from "@gnosis.pm/safe-contracts/build/artifacts/contracts/handler/CompatibilityFallbackHandler.sol/CompatibilityFallbackHandler.json"; | ||
import GnosisSafeProxyFactory from "@gnosis.pm/safe-contracts/build/artifacts/contracts/proxies/GnosisSafeProxyFactory.sol/GnosisSafeProxyFactory.json"; | ||
import { Signer, Contract } from "ethers"; | ||
import { ethers, waffle } from "hardhat"; | ||
|
||
export class GnosisSafeManager { | ||
constructor( | ||
readonly deployer: Signer, | ||
readonly masterCopy: Contract, | ||
readonly signingFallback: Contract, | ||
readonly proxyFactory: Contract, | ||
) {} | ||
|
||
static async init(deployer: Signer): Promise<GnosisSafeManager> { | ||
const masterCopy = await waffle.deployContract(deployer, GnosisSafe); | ||
const proxyFactory = await waffle.deployContract( | ||
deployer, | ||
GnosisSafeProxyFactory, | ||
); | ||
const signingFallback = await waffle.deployContract( | ||
deployer, | ||
CompatibilityFallbackHandler, | ||
); | ||
return new GnosisSafeManager( | ||
deployer, | ||
masterCopy, | ||
signingFallback, | ||
proxyFactory, | ||
); | ||
} | ||
|
||
async newSafe( | ||
owners: string[], | ||
threshold: number, | ||
fallback = ethers.constants.AddressZero, | ||
): Promise<Contract> { | ||
const proxyAddress = await this.proxyFactory.callStatic.createProxy( | ||
this.masterCopy.address, | ||
"0x", | ||
); | ||
await this.proxyFactory.createProxy(this.masterCopy.address, "0x"); | ||
const safe = await ethers.getContractAt(GnosisSafe.abi, proxyAddress); | ||
await safe.setup( | ||
owners, | ||
threshold, | ||
ethers.constants.AddressZero, | ||
"0x", | ||
fallback, | ||
ethers.constants.AddressZero, | ||
0, | ||
ethers.constants.AddressZero, | ||
); | ||
return safe; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this should be the default value, is this to "freeze" the fork in case there are incompatible changes in a future fork?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that was left over when I was trying some stuff out. I'll remove it. In fact, the block gas limit setting can also be removed as the default is the same here.