Skip to content

Contract v1.2.0 #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f463f63
Upsate safe-contracts dependencies to v1.2.0
germartinez Oct 15, 2020
dad7cbb
Update Safe Abi with isModuleEnabled
germartinez Oct 15, 2020
bc50547
Update CPK contracts with new Safe contract names
germartinez Oct 15, 2020
bcff00b
Rename Safe contract names form v1.2.0 in the CPK
germartinez Oct 15, 2020
7372e40
Replace masterCopyAddress with v1.2.0
germartinez Oct 15, 2020
da71d3b
Refactor isModuleEnabled method
germartinez Oct 15, 2020
a821bd0
Create a contract manager
germartinez Oct 16, 2020
629603d
Code formatting
germartinez Oct 16, 2020
9f89285
Calculate proxy contract in ContractManager
germartinez Oct 16, 2020
4326af7
Add Safe module methods to ContractManager
germartinez Oct 16, 2020
a23ddc0
Add structure to support different contract versions
germartinez Oct 16, 2020
f13eb1d
Add a Safe ABI for each contract version
germartinez Oct 16, 2020
a5ff65d
Add a version list of masterCopy addresses
germartinez Oct 20, 2020
9952203
Calculate the contract version manager
germartinez Oct 20, 2020
ee60aef
Organize imports
germartinez Oct 20, 2020
ff1389d
Add a second GnosisSafe contract in tests
germartinez Oct 20, 2020
572999f
Update networks structure with multiple versions of masterCopy
germartinez Oct 21, 2020
9acf5e3
Format code
germartinez Oct 21, 2020
5f81257
Fix Gnosis Safe setup parameter type
germartinez Oct 21, 2020
4222c62
Add VERSION function to GnosisSafe ABIs
germartinez Oct 21, 2020
c62503c
Fix contract version calculus
germartinez Oct 21, 2020
972e4e6
Uncomment Safe Relay tests
germartinez Oct 21, 2020
5ae0b85
Update error messages
germartinez Dec 24, 2020
436ebe1
Make masterCopyAddress optional in NetworkConfig
germartinez Dec 24, 2020
f5bc4d8
Fix error message in tests
germartinez Dec 24, 2020
c786dd9
Handle contract versions if proxy is upgraded pointing to a new maste…
germartinez Dec 30, 2020
17efc1f
Rename contract version managers
germartinez Dec 30, 2020
69db77a
Rename folder to contractManager
germartinez Dec 30, 2020
d62b10e
Fix xDai network config
germartinez Jan 7, 2021
d5e2b31
Remove async from abstract method
germartinez Jan 7, 2021
0aeb665
Update dependencies
germartinez Jan 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/CPKFactory.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pragma solidity >=0.5.0 <0.7.0;

import { Enum } from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import { Proxy } from "@gnosis.pm/safe-contracts/contracts/proxies/Proxy.sol";
import { GnosisSafeProxy } from "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol";
import { GnosisSafe } from "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol";

contract CPKFactory {
event ProxyCreation(Proxy proxy);
event ProxyCreation(GnosisSafeProxy proxy);

function proxyCreationCode() external pure returns (bytes memory) {
return type(Proxy).creationCode;
return type(GnosisSafeProxy).creationCode;
}

function createProxyAndExecTransaction(
Expand All @@ -24,7 +24,7 @@ contract CPKFactory {
returns (bool execTransactionSuccess)
{
GnosisSafe proxy;
bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, abi.encode(masterCopy));
bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, abi.encode(masterCopy));
bytes32 salt = keccak256(abi.encode(msg.sender, saltNonce));
// solium-disable-next-line security/no-inline-assembly
assembly {
Expand All @@ -49,6 +49,6 @@ contract CPKFactory {
abi.encodePacked(uint(address(this)), uint(0), uint8(1))
);

emit ProxyCreation(Proxy(address(proxy)));
emit ProxyCreation(GnosisSafeProxy(address(proxy)));
}
}
4 changes: 3 additions & 1 deletion contracts/Deps.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
pragma solidity >=0.5.0 <0.7.0;

import { ProxyFactory } from "@gnosis.pm/safe-contracts/contracts/proxies/ProxyFactory.sol";
import { GnosisSafeProxyFactory } from "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol";
import { MultiSend } from "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol";
import { GnosisSafe } from "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol";
import { DefaultCallbackHandler } from "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol";
import { DailyLimitModule } from "@gnosis.pm/safe-contracts/contracts/modules/DailyLimitModule.sol";
import { ConditionalTokens } from "@gnosis.pm/conditional-tokens-contracts/contracts/ConditionalTokens.sol";
import { ERC20Mintable } from "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol";

contract GnosisSafe2 is GnosisSafe {}
3 changes: 2 additions & 1 deletion migrations-ts/1-deploy-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = function (deployer: Truffle.Deployer, network: string) {
if (network === 'test' || network === 'local') {
;[
'GnosisSafe',
'ProxyFactory',
'GnosisSafe2',
'GnosisSafeProxyFactory',
'MultiSend',
'DefaultCallbackHandler',
'Multistep',
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,48 @@
"homepage": "https://github.com/gnosis/contract-proxy-kit#readme",
"dependencies": {
"@gnosis.pm/safe-apps-sdk": "^0.4.2",
"@truffle/contract": "^4.2.26",
"@truffle/contract": "^4.3.4",
"@types/uuid": "^8.3.0",
"bignumber.js": "^9.0.1",
"node-fetch": "^2.6.1",
"uuid": "^8.3.1"
"uuid": "^8.3.2"
},
"devDependencies": {
"@gnosis.pm/conditional-tokens-contracts": "^0.5.4",
"@gnosis.pm/safe-contracts": "1.1.1",
"@truffle/hdwallet-provider": "^1.1.1",
"@gnosis.pm/safe-contracts": "1.2.0",
"@truffle/hdwallet-provider": "^1.2.1",
"@typechain/truffle-v5": "^2.0.2",
"@types/chai": "^4.2.14",
"@types/chai-as-promised": "^7.1.3",
"@types/mocha": "^8.0.3",
"@types/mocha": "^8.2.0",
"@types/node-fetch": "^2.5.7",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.5.0",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"coveralls": "^3.1.0",
"dotenv": "^8.2.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.13.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.1",
"ethers-4": "npm:ethers@^4.0.45",
"ethers-5": "npm:ethers@^5.0.18",
"ganache-cli": "^6.12.0",
"geth-dev-assistant": "^0.1.7",
"ethers-5": "npm:ethers@^5.0.24",
"ganache-cli": "^6.12.1",
"geth-dev-assistant": "^0.1.8",
"jsdom": "^16.4.0",
"jsdom-global": "^3.0.2",
"nyc": "^15.1.0",
"prettier": "^2.1.2",
"prettier": "^2.2.1",
"prettier-eslint-cli": "^5.0.0",
"run-with-testrpc": "^0.3.1",
"should": "^13.2.3",
"truffle": "^5.1.49",
"truffle": "^5.1.60",
"truffle-typings": "^1.0.8",
"ts-node": "^9.0.0",
"ts-node": "^9.1.1",
"typechain": "^3.0.0",
"typescript": "^4.0.3",
"typescript": "^4.1.3",
"wait-port": "^0.2.9",
"web3-1-3": "npm:web3@^1.3.0",
"web3-1-3": "npm:web3@^1.3.1",
"web3-2-alpha": "npm:web3@^2.0.0-alpha.1"
}
}
Loading