Skip to content

Commit

Permalink
Inomurko/vault+authority (#678)
Browse files Browse the repository at this point in the history
* migrate with vault and gnosis
  • Loading branch information
Ino Murko committed Aug 19, 2020
1 parent e37d1e2 commit 78ca6e8
Show file tree
Hide file tree
Showing 24 changed files with 6,307 additions and 137 deletions.
36 changes: 34 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install v9
node --version
node -v
nvm alias default v9
echo 'export PATH="$(npm bin):$PATH"' >> $BASH_ENV
- run:
Expand All @@ -104,8 +103,41 @@ jobs:
npm install -g npm@latest
nvm use node
npm install
npx truffle migrate 0xa508dD875f10C33C52a8abb20E16fc68E981F186 1
npx truffle migrate --accounts 0xa508dD875f10C33C52a8abb20E16fc68E981F186 --confirmations 1
working_directory: ~/repo/MultiSigWallet
- run:
name: Install node 12
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install v12
node --version
nvm alias default v12
echo 'export PATH="$(npm bin):$PATH"' >> $BASH_ENV
- restore_cache:
keys:
- dependencies-machine-v1-{{ checksum "~/repo/plasma_framework/package-lock.json" }}
- run:
name: Install dependencies
working_directory: ~/repo/plasma_framework
command: |
npm version
node --version
npm install
- save_cache:
key: dependencies-machine-v1-{{ checksum "~/repo/plasma_framework/package-lock.json" }}
paths:
- ~/repo/plasma_framework/node_modules
- run:
name: Deploy Plasma Contracts
command: |
npx truffle migrate --network local
environment:
VAULT: true
VAULT_ADDR: https://127.0.0.1:8200
VAULT_TOKEN: totally-secure
NODE_TLS_REJECT_UNAUTHORIZED: 0
VAULT_RPC_REMOTE_URL: http://ganache:8545
working_directory: ~/repo/plasma_framework

Truffle tests:
executor: truffle_executor
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ tenderly.yaml

MultiSigWallet
MultiSigWalletOverride/ganache_data/
MultiSigWalletOverride/docker/immutability/ca/
2 changes: 2 additions & 0 deletions MultiSigWalletOverride/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
init_multisig:
cp ../MultiSigWalletOverride/migrations/* ../MultiSigWallet/migrations
cp ../MultiSigWalletOverride/truffle.js ../MultiSigWallet/
cp ../MultiSigWalletOverride/package.json ../MultiSigWallet/
cp ../MultiSigWalletOverride/package-lock.json ../MultiSigWallet/
Empty file modified MultiSigWalletOverride/docker/immutability/config/entrypoint.sh
100644 → 100755
Empty file.
Empty file modified MultiSigWalletOverride/docker/immutability/config/gencerts.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions MultiSigWalletOverride/migrations/1_initial_migration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const Migrations = artifacts.require("./Migrations.sol")

module.exports = async (deployer, _, [deployerAddress]) => {
// Deploy migrations
await deployer.deploy(Migrations);
};
34 changes: 16 additions & 18 deletions MultiSigWalletOverride/migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ const MultisigWalletFactory = artifacts.require('MultiSigWalletWithDailyLimitFac
const fs = require('fs');
const path = require('path');

module.exports = deployer => {
module.exports = async (deployer, [_deployerAddress]) => {
const args = process.argv.slice();
if (process.env.DEPLOY_FACTORY){
deployer.deploy(MultisigWalletFactory);
console.log("Factory with Daily Limit deployed");
} else if (args.length < 5) {
console.error("Multisig with daily limit requires to pass owner " +
"list, required confirmations and daily limit");
} else if (args.length < 6) {
deployer.deploy(MultisigWalletWithoutDailyLimit, args[3].split(","), args[4]).then(function() {
const buildDir = path.resolve(__dirname, '../build');
if (!fs.existsSync(buildDir)) {
fs.mkdirSync(buildDir);
}
fs.writeFileSync(path.resolve(buildDir, 'multisig_instance'), `${MultisigWalletWithoutDailyLimit.address}`.toLowerCase());
});
console.log("Wallet deployed");
const accountsIndex = args.indexOf('--accounts');
const confirmationsIndex = args.indexOf('--confirmations');
const numberOfConfirmations = args[confirmationsIndex + 1];
const accounts = args[accountsIndex + 1].split(",");
if (accountsIndex === -1 || confirmationsIndex === -1) {
console.error('ABORTED. Use: --accounts 0xasdf,0xfdsa --confirmations 2');
process.exit(1);
} else {
deployer.deploy(MultisigWalletWithDailyLimit, args[3].split(","), args[4], args[5]);
console.log("Wallet with Daily Limit deployed");
console.log(`Accounts: ${accounts}`);
console.log(`Confirmations: ${numberOfConfirmations}`);
await deployer.deploy(MultisigWalletWithoutDailyLimit, accounts, numberOfConfirmations);
const buildDir = path.resolve(__dirname, '../build');
if (!fs.existsSync(buildDir)) {
fs.mkdirSync(buildDir);
}
fs.writeFileSync(path.resolve(buildDir, 'multisig_instance'), `${MultisigWalletWithoutDailyLimit.address}`.toLowerCase());
}
}
Loading

0 comments on commit 78ca6e8

Please sign in to comment.