├── apt-packages ├── .gitattributes ├── dapp ├── tests │ └── globalvars.js ├── build │ ├── icon.icns │ ├── icon.ico │ ├── icon_16x16x32.png │ ├── icon_32x32x32.png │ ├── icon_48x48x32.png │ ├── icon_128x128x32.png │ ├── icon_256x256x32.png │ └── icon_512x512x32.png ├── src │ ├── partials │ │ ├── paramValueData.html │ │ ├── 404.html │ │ ├── txData.html │ │ ├── multisigData.html │ │ ├── addressPopoverTemplate.html │ │ ├── modals │ │ │ ├── revokeConfirmation.html │ │ │ ├── confirmTransaction.html │ │ │ ├── executeTransaction.html │ │ │ ├── resetSettings.html │ │ │ ├── showSeed.html │ │ │ ├── importWalletConfiguration.html │ │ │ ├── editOwner.html │ │ │ ├── showNonce.html │ │ │ ├── signedTransaction.html │ │ │ ├── showSignedTransaction.html │ │ │ ├── retrieveNonce.html │ │ │ ├── signOffline.html │ │ │ ├── simulatedTransaction.html │ │ │ ├── confirmTransactionOffline.html │ │ │ ├── removeWalletOwnerOffline.html │ │ │ ├── executeMultisigTransactionOffline.html │ │ │ ├── getNonce.html │ │ │ ├── revokeMultisigConfirmationOffline.html │ │ │ ├── selectNewWallet.html │ │ │ ├── editABI.html │ │ │ ├── spinner.html │ │ │ ├── removeOwner.html │ │ │ ├── removeAddressFromBook.html │ │ │ ├── addOwner.html │ │ │ ├── addAddressToBook.html │ │ │ ├── editAddressBookItem.html │ │ │ ├── editLightWalletAccount.html │ │ │ ├── editWallet.html │ │ │ ├── exportWalletConfiguration.html │ │ │ ├── replaceOwnerOffline.html │ │ │ ├── restoreWallet.html │ │ │ ├── deposit.html │ │ │ ├── depositToken.html │ │ │ ├── setLimit.html │ │ │ ├── updateRequired.html │ │ │ ├── signMultisigConfirmationRevokeOffline.html │ │ │ ├── restoreSeed.html │ │ │ ├── web3Wallets.html │ │ │ ├── lightWalletPassword.html │ │ │ ├── removeWallet.html │ │ │ ├── removeLightWalletAccount.html │ │ │ ├── chooseWeb3Wallet.html │ │ │ ├── withdrawToken.html │ │ │ ├── replaceOwner.html │ │ │ ├── addWalletOwner.html │ │ │ ├── removeToken.html │ │ │ ├── withdrawLimit.html │ │ │ ├── selectAddressFromBook.html │ │ │ ├── configureGas.html │ │ │ ├── disclaimerElectron.html │ │ │ ├── askLightWalletPassword.html │ │ │ ├── editToken.html │ │ │ ├── ledgerHelp.html │ │ │ ├── disclaimer.html │ │ │ ├── safeMigration.html │ │ │ ├── importLightWalletAccount.html │ │ │ ├── walletTransaction.html │ │ │ └── sendTransaction.html │ │ ├── editable-select-settings-tpl.html │ │ ├── editable-select-contract-settings-tpl.html │ │ ├── addressBook.html │ │ ├── accounts.html │ │ └── settings.html │ ├── bundles │ │ ├── img │ │ │ ├── icon.icns │ │ │ ├── icon.ico │ │ │ ├── icon.png │ │ │ ├── ledger.jpg │ │ │ ├── wallet-logo.png │ │ │ ├── web3-provider.png │ │ │ ├── ledger-provider.png │ │ │ └── wallet-logo.svg │ │ └── fonts │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ ├── TermsofUseMultisig.pdf │ ├── app.js │ ├── controllers │ │ ├── signOfflineCtrl.js │ │ ├── replaceOwnerOfflineCtrl.js │ │ ├── footerCtrl.js │ │ ├── removeWalletCtrl.js │ │ ├── revokeCtrl.js │ │ ├── confirmTransactionCtrl.js │ │ ├── exportWalletConfigCtrl.js │ │ ├── importWalletConfigCtrl.js │ │ ├── nonceCtrl.js │ │ ├── replaceOwnerCtrl.js │ │ ├── confirmMultisigTransactionOfflineCtrl.js │ │ ├── editABICtrl.js │ │ ├── executeTransactionCtrl.js │ │ ├── depositCtrl.js │ │ ├── removeOwnerCtrl.js │ │ ├── updateRequiredCtrl.js │ │ ├── setLimitCtrl.js │ │ ├── withdrawLimitCtrl.js │ │ ├── depositTokenCtrl.js │ │ ├── signedTransactionCtrl.js │ │ ├── addTokenCtrl.js │ │ ├── withdrawTokenCtrl.js │ │ └── addOwnerCtrl.js │ ├── services │ │ ├── Config.js │ │ ├── Connection.js │ │ ├── ABI.js │ │ └── CommunicationBus.js │ └── routes.js ├── less │ ├── mixins │ │ ├── center-block.less │ │ ├── size.less │ │ ├── opacity.less │ │ ├── text-emphasis.less │ │ ├── text-overflow.less │ │ ├── background-variant.less │ │ ├── resize.less │ │ ├── labels.less │ │ ├── progress-bar.less │ │ ├── nav-divider.less │ │ ├── reset-filter.less │ │ ├── alerts.less │ │ ├── tab-focus.less │ │ ├── nav-vertical-align.less │ │ ├── responsive-visibility.less │ │ ├── reset-text.less │ │ ├── border-radius.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── hide-text.less │ │ ├── list-group.less │ │ ├── clearfix.less │ │ ├── table-row.less │ │ ├── image.less │ │ ├── buttons.less │ │ ├── forms.less │ │ └── grid-framework.less │ ├── .csslintrc │ ├── wells.less │ ├── breadcrumbs.less │ ├── responsive-embed.less │ ├── component-animations.less │ ├── close.less │ ├── thumbnails.less │ ├── utilities.less │ ├── pager.less │ ├── media.less │ ├── mixins.less │ ├── labels.less │ ├── jumbotron.less │ ├── badges.less │ ├── bootstrap.less │ ├── code.less │ ├── grid.less │ ├── alerts.less │ ├── progress-bars.less │ ├── pagination.less │ ├── print.less │ └── tooltip.less ├── testrpc.sh ├── Readme.md ├── css │ └── gnosis-bootstrap-dialog.css └── config.karma.js ├── migrations ├── 1_initial_migration.js └── 2_deploy_contracts.js ├── truffle.js ├── prepare_deploy_win.sh ├── .eslintrc.js ├── truffle_test_runner.sh ├── contracts ├── Migrations.sol ├── MultiSigWalletFactory.sol ├── MultiSigWalletWithDailyLimitFactory.sol ├── TestCalls.sol └── Factory.sol ├── .gitignore ├── package.json ├── prepare_deploy_linux.sh ├── appveyor.yml ├── .travis.yml └── test └── javascript ├── utils.js ├── testExternalCallsWithDailyLimit.js ├── testMultiSigWalletWithDailyLimitFactory.js └── testExecutionAfterRequirementsChanged.js /apt-packages: -------------------------------------------------------------------------------- 1 | libusb-1.0-0-dev 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /dapp/tests/globalvars.js: -------------------------------------------------------------------------------- 1 | var isElectron = false; 2 | var ledgerPort = 8080; 3 | -------------------------------------------------------------------------------- /dapp/build/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon.icns -------------------------------------------------------------------------------- /dapp/build/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon.ico -------------------------------------------------------------------------------- /dapp/src/partials/paramValueData.html: -------------------------------------------------------------------------------- 1 |
2 | {{param.value}} 3 |
4 | -------------------------------------------------------------------------------- /dapp/build/icon_16x16x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon_16x16x32.png -------------------------------------------------------------------------------- /dapp/build/icon_32x32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon_32x32x32.png -------------------------------------------------------------------------------- /dapp/build/icon_48x48x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon_48x48x32.png -------------------------------------------------------------------------------- /dapp/build/icon_128x128x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon_128x128x32.png -------------------------------------------------------------------------------- /dapp/build/icon_256x256x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon_256x256x32.png -------------------------------------------------------------------------------- /dapp/build/icon_512x512x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/build/icon_512x512x32.png -------------------------------------------------------------------------------- /dapp/src/bundles/img/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/icon.icns -------------------------------------------------------------------------------- /dapp/src/bundles/img/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/icon.ico -------------------------------------------------------------------------------- /dapp/src/bundles/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/icon.png -------------------------------------------------------------------------------- /dapp/src/TermsofUseMultisig.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/TermsofUseMultisig.pdf -------------------------------------------------------------------------------- /dapp/src/bundles/img/ledger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/ledger.jpg -------------------------------------------------------------------------------- /dapp/src/bundles/img/wallet-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/wallet-logo.png -------------------------------------------------------------------------------- /dapp/src/bundles/img/web3-provider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/web3-provider.png -------------------------------------------------------------------------------- /dapp/src/bundles/img/ledger-provider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/img/ledger-provider.png -------------------------------------------------------------------------------- /dapp/src/bundles/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("./Migrations.sol") 2 | 3 | module.exports = deployer => deployer.deploy(Migrations) 4 | -------------------------------------------------------------------------------- /dapp/src/bundles/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /dapp/src/bundles/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /dapp/src/bundles/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /dapp/src/bundles/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnosis/MultiSigWallet/HEAD/dapp/src/bundles/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /dapp/less/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /dapp/src/partials/404.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Page not found 4 |

5 |

6 | The resource you're looking for doesn't exist. 7 |

8 | 9 |
-------------------------------------------------------------------------------- /dapp/src/partials/txData.html: -------------------------------------------------------------------------------- 1 |
2 | {{transaction.info.input|limitTo:1000}} 3 | ... 4 |
5 | -------------------------------------------------------------------------------- /dapp/src/partials/multisigData.html: -------------------------------------------------------------------------------- 1 |
2 | {{transactions[txId].data|limitTo:1000}} 3 | ... 4 |
5 | -------------------------------------------------------------------------------- /dapp/less/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /dapp/less/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /dapp/less/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover, 6 | a&:focus { 7 | color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dapp/less/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /dapp/less/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover, 6 | a&:focus { 7 | background-color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dapp/less/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /dapp/src/partials/addressPopoverTemplate.html: -------------------------------------------------------------------------------- 1 | 6 | {{param.value}} -------------------------------------------------------------------------------- /dapp/less/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dapp/src/app.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular.module( 4 | 'multiSigWeb', 5 | [ 6 | 'ui.bootstrap', 7 | 'ngRoute', 8 | 'ngclipboard', 9 | 'ui-notification' 10 | ] 11 | ); 12 | } 13 | )(); 14 | -------------------------------------------------------------------------------- /dapp/less/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /truffle.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | networks: { 3 | development: { 4 | host: "localhost", 5 | port: 8545, 6 | network_id: "*", // Match any network id 7 | gas: 4000000, 8 | gasPrice: 10000000000, // 10 gwei 9 | } 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /dapp/less/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /dapp/less/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /dapp/less/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /prepare_deploy_win.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "=== PREPARE DEPLOY ===" 4 | 5 | if [[ ${APPVEYOR_REPO_TAG} == true ]]; then 6 | # it is a TAG 7 | # rename .exe file 8 | echo "Renaming multisigweb.*.exe to multisigweb-$APPVEYOR_REPO_TAG.exe" 9 | mv dapp/dist/multisigweb*.exe dapp/dist/multisigweb-$APPVEYOR_REPO_TAG.exe 10 | fi 11 | 12 | echo "=== PREPARE DEPLOY DONE ===" 13 | -------------------------------------------------------------------------------- /dapp/less/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // WebKit-specific. Other browsers will keep their default outline style. 5 | // (Initially tried to also force default via `outline: initial`, 6 | // but that seems to erroneously remove the outline in Firefox altogether.) 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/revokeConfirmation.html: -------------------------------------------------------------------------------- 1 | 6 | 14 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/confirmTransaction.html: -------------------------------------------------------------------------------- 1 | 6 | 14 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/executeTransaction.html: -------------------------------------------------------------------------------- 1 | 6 | 14 | -------------------------------------------------------------------------------- /dapp/less/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /dapp/less/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table !important; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /dapp/src/controllers/signOfflineCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("signOfflineCtrl", function ($scope, Wallet, Utils, Transaction, $uibModalInstance) { 6 | 7 | $scope.ok = function () { 8 | $uibModalInstance.close($scope.nonce); 9 | }; 10 | 11 | $scope.cancel = function () { 12 | $uibModalInstance.dismiss(); 13 | }; 14 | 15 | }); 16 | } 17 | )(); 18 | -------------------------------------------------------------------------------- /dapp/testrpc.sh: -------------------------------------------------------------------------------- 1 | # npm rebuild leveldown scrypt; 2 | echo "Starting Testrpc..." 3 | ganache-cli -d --port 8545 --account "0xb21e287e6dcb34cf16abb6ce71f7209906c13f763c6415c6b2320eea7688212f, 10000000000000000000000000" --account "0x3ba8150286625233d3154d795527e3cbbc07a135d14392e9485f08d2d555fb3d, 10000000000000000000000000" & 4 | testrpc_pid=$! 5 | sleep 5 6 | 7 | echo "Running Karma tests..." 8 | karma start config.karma.js 9 | 10 | echo "Shutting down TestRpc..." 11 | kill -9 $testrpc_pid 12 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "eslint:recommended", 3 | "parser": "babel-eslint", 4 | "parserOptions": { 5 | "sourceType": "script" 6 | }, 7 | "rules": { 8 | "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }] 9 | }, 10 | "env": { 11 | "node": true, 12 | "mocha": true, 13 | "es6": true 14 | }, 15 | "globals": { 16 | "assert": true, 17 | "artifacts": true, 18 | "contract": true, 19 | "web3": true 20 | } 21 | }; -------------------------------------------------------------------------------- /dapp/src/partials/modals/resetSettings.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 18 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/showSeed.html: -------------------------------------------------------------------------------- 1 | 6 | 11 | 19 | -------------------------------------------------------------------------------- /dapp/less/.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "box-model": false, 5 | "compatible-vendor-prefixes": false, 6 | "floats": false, 7 | "font-sizes": false, 8 | "gradients": false, 9 | "important": false, 10 | "known-properties": false, 11 | "outline-none": false, 12 | "qualified-headings": false, 13 | "regex-selectors": false, 14 | "shorthand": false, 15 | "text-indent": false, 16 | "unique-headings": false, 17 | "universal-selector": false, 18 | "unqualified-attributes": false 19 | } 20 | -------------------------------------------------------------------------------- /dapp/less/mixins/reset-text.less: -------------------------------------------------------------------------------- 1 | .reset-text() { 2 | font-family: @font-family-base; 3 | // We deliberately do NOT reset font-size. 4 | font-style: normal; 5 | font-weight: normal; 6 | letter-spacing: normal; 7 | line-break: auto; 8 | line-height: @line-height-base; 9 | text-align: left; // Fallback for where `start` is not supported 10 | text-align: start; 11 | text-decoration: none; 12 | text-shadow: none; 13 | text-transform: none; 14 | white-space: normal; 15 | word-break: normal; 16 | word-spacing: normal; 17 | word-wrap: normal; 18 | } 19 | -------------------------------------------------------------------------------- /truffle_test_runner.sh: -------------------------------------------------------------------------------- 1 | # Tests have to be executed separately due to https://github.com/ethereumjs/testrpc/issues/346 2 | truffle compile 3 | run-with-testrpc -d 'truffle test test/javascript/testMultiSigWalletWithDailyLimit.js' 4 | run-with-testrpc -d 'truffle test test/javascript/testMultiSigWalletWithDailyLimitFactory.js' 5 | run-with-testrpc -d 'truffle test test/javascript/testExecutionAfterRequirementsChanged.js' 6 | run-with-testrpc -d 'truffle test test/javascript/testExternalCalls.js' 7 | run-with-testrpc -d 'truffle test test/javascript/testExternalCallsWithDailyLimit.js' 8 | -------------------------------------------------------------------------------- /dapp/less/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/importWalletConfiguration.html: -------------------------------------------------------------------------------- 1 | 6 | 11 | 19 | -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.15; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | modifier restricted() { 8 | if (msg.sender == owner) _; 9 | } 10 | 11 | function Migrations() { 12 | owner = msg.sender; 13 | } 14 | 15 | function setCompleted(uint completed) restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dapp/less/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | line-height: @line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | .border-left-radius(@border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | .border-right-radius(@border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/editOwner.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/showNonce.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/signedTransaction.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/showSignedTransaction.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/retrieveNonce.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/signOffline.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 19 |
20 | -------------------------------------------------------------------------------- /dapp/less/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /dapp/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/simulatedTransaction.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/less/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (has been removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/confirmTransactionOffline.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 19 |
20 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/removeWalletOwnerOffline.html: -------------------------------------------------------------------------------- 1 | 6 | 12 | 20 | -------------------------------------------------------------------------------- /dapp/less/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a&, 9 | button& { 10 | color: @color; 11 | 12 | .list-group-item-heading { 13 | color: inherit; 14 | } 15 | 16 | &:hover, 17 | &:focus { 18 | color: @color; 19 | background-color: darken(@background, 5%); 20 | } 21 | &.active, 22 | &.active:hover, 23 | &.active:focus { 24 | color: #fff; 25 | background-color: @color; 26 | border-color: @color; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/executeMultisigTransactionOffline.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 19 |
20 | -------------------------------------------------------------------------------- /dapp/less/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/getNonce.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 21 |
22 | -------------------------------------------------------------------------------- /dapp/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dapp/less/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /dapp/src/controllers/replaceOwnerOfflineCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("replaceOwnerOfflineCtrl", function ($scope, Wallet, Utils, wallet, $uibModalInstance) { 6 | $scope.sign = function () { 7 | Wallet.replaceOwnerOffline(wallet.address, $scope.oldOwner, $scope.newOwner, function (e, tx) { 8 | if (e) { 9 | Utils.dangerAlert(e); 10 | } 11 | else { 12 | $uibModalInstance.close(); 13 | Utils.signed(tx); 14 | } 15 | }); 16 | }; 17 | 18 | $scope.cancel = function () { 19 | $uibModalInstance.dismiss(); 20 | }; 21 | 22 | }); 23 | } 24 | )(); 25 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/revokeMultisigConfirmationOffline.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 19 |
20 | -------------------------------------------------------------------------------- /dapp/src/controllers/footerCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module('multiSigWeb') 5 | .controller('footerCtrl', function ($scope, Utils) { 6 | $scope.navCollapsed = true; 7 | 8 | // electron show terms and policy 9 | // `shell` is an Electron only command 10 | $scope.openTerms = function() { 11 | Utils.openResource(txDefault.resources.termsOfUse); 12 | } 13 | 14 | $scope.openPolicy = function () { 15 | Utils.openResource(txDefault.resources.privacyPolicy); 16 | } 17 | 18 | $scope.openImprint = function () { 19 | Utils.openResource(txDefault.resources.imprint); 20 | } 21 | 22 | }); 23 | } 24 | )(); 25 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/selectNewWallet.html: -------------------------------------------------------------------------------- 1 | 6 | 20 | 28 | -------------------------------------------------------------------------------- /dapp/src/controllers/removeWalletCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("removeWalletCtrl", function ($rootScope, $scope, $uibModalInstance, wallet, Wallet, Utils, callback) { 6 | 7 | $scope.wallet = wallet; 8 | $scope.ok = function () { 9 | Wallet.removeWallet($scope.wallet.address); 10 | try{ 11 | $rootScope.wallets = Wallet.getAllWallets(); 12 | }catch(err){ 13 | console.log(err); 14 | } 15 | $uibModalInstance.close(); 16 | Utils.success("The wallet was removed successfully."); 17 | callback(); 18 | }; 19 | 20 | $scope.cancel = function () { 21 | $uibModalInstance.dismiss(); 22 | }; 23 | 24 | }); 25 | } 26 | )(); 27 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/editABI.html: -------------------------------------------------------------------------------- 1 | 6 | 17 | 25 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/spinner.html: -------------------------------------------------------------------------------- 1 | 6 | 22 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/removeOwner.html: -------------------------------------------------------------------------------- 1 | 6 | 16 | 24 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/removeAddressFromBook.html: -------------------------------------------------------------------------------- 1 | 6 | 16 | 24 | -------------------------------------------------------------------------------- /dapp/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/addOwner.html: -------------------------------------------------------------------------------- 1 | 6 | 16 | 24 | -------------------------------------------------------------------------------- /contracts/MultiSigWalletFactory.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.15; 2 | import "./Factory.sol"; 3 | import "./MultiSigWallet.sol"; 4 | 5 | 6 | /// @title Multisignature wallet factory - Allows creation of multisig wallet. 7 | /// @author Stefan George - 8 | contract MultiSigWalletFactory is Factory { 9 | 10 | /* 11 | * Public functions 12 | */ 13 | /// @dev Allows verified creation of multisignature wallet. 14 | /// @param _owners List of initial owners. 15 | /// @param _required Number of required confirmations. 16 | /// @return Returns wallet address. 17 | function create(address[] _owners, uint _required) 18 | public 19 | returns (address wallet) 20 | { 21 | wallet = new MultiSigWallet(_owners, _required); 22 | register(wallet); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /dapp/less/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/addAddressToBook.html: -------------------------------------------------------------------------------- 1 | 6 | 16 | 24 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/editAddressBookItem.html: -------------------------------------------------------------------------------- 1 | 6 | 16 | 24 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/editLightWalletAccount.html: -------------------------------------------------------------------------------- 1 | 6 | 19 | 29 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/editWallet.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 17 | 25 |
26 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/exportWalletConfiguration.html: -------------------------------------------------------------------------------- 1 | 6 | 16 | 24 | -------------------------------------------------------------------------------- /dapp/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dapp/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/replaceOwnerOffline.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 17 | 25 |
26 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/restoreWallet.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 17 | 25 |
26 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/deposit.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 24 |
25 | -------------------------------------------------------------------------------- /dapp/src/services/Config.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .service("Config", function () { 6 | var factory = { 7 | updates: 0 8 | }; 9 | 10 | factory.getUserConfiguration = function () { 11 | return Object.assign({}, txDefault, JSON.parse(localStorage.getItem("userConfig"))); 12 | }; 13 | 14 | factory.getConfiguration = function (key) { 15 | return JSON.parse(localStorage.getItem(key)); 16 | }; 17 | 18 | factory.setConfiguration = function (key, value) { 19 | localStorage.setItem(key, value); 20 | this.triggerUpdates(); 21 | }; 22 | 23 | factory.removeConfiguration = function (key) { 24 | localStorage.removeItem(key); 25 | this.triggerUpdates(); 26 | }; 27 | 28 | factory.triggerUpdates = function () { 29 | this.updates++; 30 | }; 31 | 32 | return factory; 33 | }); 34 | } 35 | )(); 36 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/depositToken.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 24 |
25 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/setLimit.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 24 |
25 | -------------------------------------------------------------------------------- /dapp/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/updateRequired.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 13 | 24 |
25 | -------------------------------------------------------------------------------- /dapp/src/services/Connection.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module('multiSigWeb') 5 | .service('Connection', function ($rootScope, $interval) { 6 | 7 | var factory = {}; 8 | var isConnected = false; 9 | 10 | var setup = function () { 11 | // Call it at startup 12 | factory.checkConnection(); 13 | // Setup interval 14 | $interval(factory.checkConnection, txDefault.connectionChecker.checkInterval); 15 | }; 16 | 17 | function callDigest() { 18 | try{ 19 | $rootScope.$digest(); 20 | }catch(error){} 21 | } 22 | 23 | /** 24 | * Connection lookup against a defined endpoint 25 | * Check config.js for the endpoint configuration 26 | */ 27 | factory.checkConnection = function () { 28 | factory.isConnected = navigator.onLine; // true | false 29 | callDigest(); 30 | }; 31 | 32 | setup(); 33 | 34 | return factory; 35 | }); 36 | } 37 | )(); 38 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/signMultisigConfirmationRevokeOffline.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 19 | 25 |
26 | -------------------------------------------------------------------------------- /migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | const MultisigWalletWithDailyLimit = artifacts.require('MultiSigWalletWithDailyLimit.sol') 2 | const MultisigWalletWithoutDailyLimit = artifacts.require('MultiSigWallet.sol') 3 | const MultisigWalletFactory = artifacts.require('MultiSigWalletWithDailyLimitFactory.sol') 4 | 5 | module.exports = deployer => { 6 | const args = process.argv.slice() 7 | if (process.env.DEPLOY_FACTORY){ 8 | deployer.deploy(MultisigWalletFactory) 9 | console.log("Factory with Daily Limit deployed") 10 | } else if (args.length < 5) { 11 | console.error("Multisig with daily limit requires to pass owner " + 12 | "list, required confirmations and daily limit") 13 | } else if (args.length < 6) { 14 | deployer.deploy(MultisigWalletWithoutDailyLimit, args[3].split(","), args[4]) 15 | console.log("Wallet deployed") 16 | } else { 17 | deployer.deploy(MultisigWalletWithDailyLimit, args[3].split(","), args[4], args[5]) 18 | console.log("Wallet with Daily Limit deployed") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/restoreSeed.html: -------------------------------------------------------------------------------- 1 | 6 | 18 | 28 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/web3Wallets.html: -------------------------------------------------------------------------------- 1 | 8 | 22 | 27 | -------------------------------------------------------------------------------- /contracts/MultiSigWalletWithDailyLimitFactory.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.15; 2 | import "./Factory.sol"; 3 | import "./MultiSigWalletWithDailyLimit.sol"; 4 | 5 | 6 | /// @title Multisignature wallet factory for daily limit version - Allows creation of multisig wallet. 7 | /// @author Stefan George - 8 | contract MultiSigWalletWithDailyLimitFactory is Factory { 9 | 10 | /* 11 | * Public functions 12 | */ 13 | /// @dev Allows verified creation of multisignature wallet. 14 | /// @param _owners List of initial owners. 15 | /// @param _required Number of required confirmations. 16 | /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. 17 | /// @return Returns wallet address. 18 | function create(address[] _owners, uint _required, uint _dailyLimit) 19 | public 20 | returns (address wallet) 21 | { 22 | wallet = new MultiSigWalletWithDailyLimit(_owners, _required, _dailyLimit); 23 | register(wallet); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/lightWalletPassword.html: -------------------------------------------------------------------------------- 1 | 6 | 20 | 30 | -------------------------------------------------------------------------------- /contracts/TestCalls.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.15; 2 | 3 | 4 | /// @title Contract for testing low-level calls issued from the multisig wallet 5 | contract TestCalls { 6 | 7 | // msg.data.length of the latest call to "receive" methods 8 | uint public lastMsgDataLength; 9 | 10 | // msg.value of the latest call to "receive" methods 11 | uint public lastMsgValue; 12 | 13 | uint public uint1; 14 | uint public uint2; 15 | bytes public byteArray1; 16 | 17 | modifier setMsgFields { 18 | lastMsgDataLength = msg.data.length; 19 | lastMsgValue = msg.value; 20 | _; 21 | } 22 | 23 | function TestCalls() setMsgFields public { 24 | // This constructor will be used to test the creation via multisig wallet 25 | } 26 | 27 | function receive1uint(uint a) setMsgFields payable public { 28 | uint1 = a; 29 | } 30 | 31 | function receive2uints(uint a, uint b) setMsgFields payable public { 32 | uint1 = a; 33 | uint2 = b; 34 | } 35 | 36 | function receive1bytes(bytes c) setMsgFields payable public { 37 | byteArray1 = c; 38 | } 39 | 40 | function nonPayable() setMsgFields public { 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /dapp/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Basics 2 | *.py[cod] 3 | *.pyc 4 | __pycache__ 5 | 6 | # Logs 7 | *.log 8 | pip-log.txt 9 | 10 | # Unit test / coverage reports 11 | .coverage 12 | .tox 13 | nosetests.xml 14 | 15 | # Translations 16 | *.mo 17 | *.pot 18 | 19 | # Pycharm 20 | .idea 21 | 22 | # Vagrant 23 | .vagrant 24 | 25 | # Vim 26 | 27 | *~ 28 | *.swp 29 | *.swo 30 | 31 | # npm 32 | node_modules/ 33 | # package-lock.json 34 | # dapp/package-lock.json 35 | 36 | # Compass 37 | .sass-cache 38 | 39 | # sqlite 40 | *.sqlite 41 | 42 | CACHE 43 | 44 | # OS generated files # 45 | ###################### 46 | .DS_Store 47 | .DS_Store? 48 | ._* 49 | .Spotlight-V100 50 | .Trashes 51 | ehthumbs.db 52 | Thumbs.db 53 | 54 | # pip 55 | /src 56 | 57 | # Collected static files via Django's staticfiles app 58 | /staticfiles 59 | 60 | # custom multisig folders 61 | /contracts/abi 62 | /dapp/partials.js 63 | multisigWallet.zip 64 | /dapp/dist 65 | 66 | # Truffle 67 | /build 68 | 69 | # Bower 70 | dapp/bower_components 71 | 72 | # Keys 73 | dapp/localhost.crt 74 | dapp/localhost.key 75 | 76 | # Travis 77 | .travis/deploy_key 78 | 79 | # built package.json 80 | dapp/src/package.json -------------------------------------------------------------------------------- /dapp/src/partials/modals/removeWallet.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 21 | 29 |
30 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/removeLightWalletAccount.html: -------------------------------------------------------------------------------- 1 | 6 | 23 | 33 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/chooseWeb3Wallet.html: -------------------------------------------------------------------------------- 1 | 8 | 38 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/withdrawToken.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 17 | 28 |
29 | -------------------------------------------------------------------------------- /dapp/less/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | 23 | // Fix collapse in webkit from max-width: 100% and display: table-cell. 24 | &.img-thumbnail { 25 | max-width: none; 26 | } 27 | } 28 | 29 | .media-right, 30 | .media > .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /dapp/less/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/replaceOwner.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 21 | 31 |
32 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/addWalletOwner.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 17 | 30 |
31 | -------------------------------------------------------------------------------- /contracts/Factory.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.15; 2 | 3 | contract Factory { 4 | 5 | /* 6 | * Events 7 | */ 8 | event ContractInstantiation(address sender, address instantiation); 9 | 10 | /* 11 | * Storage 12 | */ 13 | mapping(address => bool) public isInstantiation; 14 | mapping(address => address[]) public instantiations; 15 | 16 | /* 17 | * Public functions 18 | */ 19 | /// @dev Returns number of instantiations by creator. 20 | /// @param creator Contract creator. 21 | /// @return Returns number of instantiations by creator. 22 | function getInstantiationCount(address creator) 23 | public 24 | constant 25 | returns (uint) 26 | { 27 | return instantiations[creator].length; 28 | } 29 | 30 | /* 31 | * Internal functions 32 | */ 33 | /// @dev Registers contract in factory registry. 34 | /// @param instantiation Address of contract instantiation. 35 | function register(address instantiation) 36 | internal 37 | { 38 | isInstantiation[instantiation] = true; 39 | instantiations[msg.sender].push(instantiation); 40 | ContractInstantiation(msg.sender, instantiation); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /dapp/src/partials/editable-select-settings-tpl.html: -------------------------------------------------------------------------------- 1 |
2 | 34 |
35 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/removeToken.html: -------------------------------------------------------------------------------- 1 | 6 | 24 | 32 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/withdrawLimit.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 17 | 30 |
31 | -------------------------------------------------------------------------------- /dapp/src/controllers/revokeCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("revokeCtrl", function ($scope, txId, address, Wallet, Transaction, $uibModalInstance, Utils) { 6 | $scope.send = function () { 7 | Wallet.revokeConfirmation(address, txId, {onlySimulate: false}, function (e, tx) { 8 | if (e) { 9 | Utils.dangerAlert(e); 10 | } 11 | else { 12 | Utils.notification("Revoke confirmation transaction was sent."); 13 | Transaction.add({txHash: tx, callback: function () { 14 | Utils.success("Revoke confirmation transaction was mined."); 15 | }}); 16 | $uibModalInstance.close(); 17 | } 18 | }); 19 | }; 20 | 21 | $scope.sign = function (){ 22 | Wallet.revokeConfirmationOffline(address, txId, function (e, tx) { 23 | if (e) { 24 | Utils.dangerAlert(e); 25 | } 26 | else{ 27 | Utils.signed(tx); 28 | $uibModalInstance.close(); 29 | } 30 | }); 31 | }; 32 | 33 | $scope.cancel = function (){ 34 | $uibModalInstance.dismiss(); 35 | }; 36 | }); 37 | } 38 | )(); 39 | -------------------------------------------------------------------------------- /dapp/src/controllers/confirmTransactionCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("confirmTransactionCtrl", function ($scope, txId, address, Wallet, Transaction, $uibModalInstance, Utils) { 6 | $scope.send = function () { 7 | Wallet.confirmTransaction(address, txId, {onlySimulate: false}, function (e, tx) { 8 | if (e) { 9 | Utils.dangerAlert(e); 10 | } 11 | else { 12 | Utils.notification("Confirmation transaction was sent."); 13 | Transaction.add({txHash: tx, callback: function () { 14 | Utils.success("Confirmation transaction was mined."); 15 | }}); 16 | $uibModalInstance.close(); 17 | } 18 | }); 19 | }; 20 | 21 | $scope.simulate = function () { 22 | Wallet.confirmTransaction(address, txId, {onlySimulate: true}, function (e, tx) { 23 | if (e) { 24 | Utils.dangerAlert(e); 25 | } 26 | else { 27 | Utils.simulatedTransaction(tx); 28 | } 29 | }); 30 | }; 31 | 32 | $scope.cancel = function () { 33 | $uibModalInstance.dismiss(); 34 | }; 35 | }); 36 | } 37 | )(); 38 | -------------------------------------------------------------------------------- /dapp/src/partials/editable-select-contract-settings-tpl.html: -------------------------------------------------------------------------------- 1 |
2 | 34 |
35 | -------------------------------------------------------------------------------- /dapp/Readme.md: -------------------------------------------------------------------------------- 1 | Ethereum Multisignature Wallet UI 2 | =================== 3 | 4 | A web user interface for the [MultiSigWallet](https://github.com/gnosis/MultiSigWallet). 5 | 6 | Requirements 7 | ------------- 8 | * Node v5+ (Confirmed working on v6.17.1 - will not work on current LTS v12.13.0) 9 | * [Grunt-cli](http://gruntjs.com/getting-started#installing-the-cli) 10 | 11 | Install 12 | ------------- 13 | ``` 14 | # For Ubuntu/Debian you need to install libusb development headers 15 | apt install -y libusb-1.0-0-dev 16 | 17 | # Latest NodeJS (v12.13.0) does NOT appear to work correctly. 18 | # You should use NVM and install Node v6.17.1 for best results: https://github.com/nvm-sh/nvm 19 | # Tested by @Privex on 2019-Nov-06 with v6.17.1 with success 20 | nvm install v6.17.1 21 | 22 | git clone https://github.com/gnosis/MultiSigWallet.git 23 | cd MultiSigWallet/dapp 24 | 25 | # node-gyp is required for 'npm install' to work correctly 26 | npm install node-gyp 27 | 28 | npm install -g grunt-cli 29 | npm install 30 | grunt 31 | ``` 32 | 33 | Test 34 | ------------- 35 | ``` 36 | npm test 37 | ``` 38 | 39 | Build 40 | ------------- 41 | 42 | Web version 43 | 44 | ``` 45 | npm run build-libs-web 46 | ``` 47 | 48 | Desktop version 49 | 50 | ``` 51 | npm run build-libs-electron 52 | ``` 53 | -------------------------------------------------------------------------------- /dapp/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/reset-text.less"; 15 | @import "mixins/text-emphasis.less"; 16 | @import "mixins/text-overflow.less"; 17 | @import "mixins/vendor-prefixes.less"; 18 | 19 | // Components 20 | @import "mixins/alerts.less"; 21 | @import "mixins/buttons.less"; 22 | @import "mixins/panels.less"; 23 | @import "mixins/pagination.less"; 24 | @import "mixins/list-group.less"; 25 | @import "mixins/nav-divider.less"; 26 | @import "mixins/forms.less"; 27 | @import "mixins/progress-bar.less"; 28 | @import "mixins/table-row.less"; 29 | 30 | // Skins 31 | @import "mixins/background-variant.less"; 32 | @import "mixins/border-radius.less"; 33 | @import "mixins/gradients.less"; 34 | 35 | // Layout 36 | @import "mixins/clearfix.less"; 37 | @import "mixins/center-block.less"; 38 | @import "mixins/nav-vertical-align.less"; 39 | @import "mixins/grid-framework.less"; 40 | @import "mixins/grid.less"; 41 | -------------------------------------------------------------------------------- /dapp/src/bundles/img/wallet-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "multisig-wallet-gnosis", 3 | "version": "1.6.0", 4 | "description": "Ethereum MultiSignature Wallet. Main module, for installing all dependencies", 5 | "scripts": { 6 | "test-dapp": "cd dapp && npm test", 7 | "test": "sh truffle_test_runner.sh", 8 | "install": "cd dapp && npm install", 9 | "start": "cd dapp && npm start" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/gnosis/MultiSigWallet.git" 14 | }, 15 | "author": "Gnosis (https://gnosis.pm/)", 16 | "license": "ISC", 17 | "bugs": { 18 | "url": "https://github.com/gnosis/MultiSigWallet/issues" 19 | }, 20 | "homepage": "https://github.com/gnosis/MultiSigWallet#readme", 21 | "eslintConfig": { 22 | "env": { 23 | "browser": true, 24 | "node": false 25 | } 26 | }, 27 | "dependencies": { 28 | "child_process": "1.0.2", 29 | "ganache-cli": "6.1.8", 30 | "solc": "0.5.8", 31 | "truffle": "3.4.11" 32 | }, 33 | "devDependencies": { 34 | "babel-eslint": "7.2.3", 35 | "eslint": "4.19.1", 36 | "eslint-config-airbnb": "15.1.0", 37 | "eslint-plugin-import": "2.12.0", 38 | "eslint-plugin-jsx-a11y": "5.1.1", 39 | "eslint-plugin-react": "7.8.2", 40 | "growl": "^1.10.5", 41 | "run-with-testrpc": "0.2.1" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /prepare_deploy_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ENABLED_BRANCH="develop" 4 | 5 | echo "=== PREPARE DEPLOY ===" 6 | 7 | # Check dist is for desktop devices and the commit was towards 8 | if [[ ${DIST} == "desktop" ]] && [[ ${TRAVIS_BRANCH} == ${ENABLED_BRANCH} || ${TRAVIS_BRANCH} == ${TRAVIS_TAG} ]] && [[ ${TRAVIS_OS_NAME} == "linux" ]]; then 9 | cd dapp/ && mkdir dist && npm run build-libs-electron && npm run build-linux; 10 | 11 | if [[ ${TRAVIS_BRANCH} == ${TRAVIS_TAG} ]]; then 12 | # it is a TAG 13 | mv multisigweb*.deb multisigweb-$TRAVIS_TAG.deb; 14 | fi 15 | fi 16 | 17 | if [[ ${DIST} == "desktop" ]] && [[ ${TRAVIS_BRANCH} == ${ENABLED_BRANCH} || ${TRAVIS_BRANCH} == ${TRAVIS_TAG} ]] && [[ ${TRAVIS_OS_NAME} == "osx" ]]; then 18 | cd dapp/ && mkdir dist && npm run build-libs-electron && npm run build-osx; 19 | 20 | if [[ ${TRAVIS_BRANCH} == ${TRAVIS_TAG} ]]; then 21 | # it is a TAG 22 | mv multisigweb*-mac.zip multisigweb-$TRAVIS_TAG-mac.zip; 23 | mv multisigweb*.dmg multisigweb-$TRAVIS_TAG.dmg; 24 | fi 25 | fi 26 | 27 | if [[ ${DIST} == "web" ]] && [[ ${TRAVIS_OS_NAME} == "linux" ]]; then 28 | # Copy package.json into the web project, it's required to load the APP version on the UI 29 | cd dapp/ && npm run build-libs-web && npm run copy-package; 30 | fi 31 | 32 | echo "=== PREPARE DEPLOY DONE ===" 33 | -------------------------------------------------------------------------------- /dapp/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /dapp/src/controllers/exportWalletConfigCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("exportWalletConfigCtrl", function ($scope, $uibModalInstance, Utils, Wallet, ABI) { 6 | 7 | $scope.exportOptions = { 8 | addressBook: false, 9 | wallets: true 10 | }; 11 | 12 | function getConfiguration () { 13 | var config = {}; 14 | config.wallets = JSON.parse(localStorage.getItem("wallets")) || {}; 15 | config.abis =ABI.get(); 16 | 17 | if ($scope.exportOptions.addressBook) { 18 | config.addressBook = JSON.parse(localStorage.getItem('addressBook') || '{}'); 19 | } 20 | 21 | var validConfig = Wallet.getValidConfigFromJSON(config || "", 'export'); 22 | return JSON.stringify(validConfig); 23 | } 24 | 25 | $scope.setConfiguration = function () { 26 | $scope.configuration = getConfiguration(); 27 | }; 28 | 29 | // Set initial configuration, users can then filter which properties to export 30 | $scope.setConfiguration(); 31 | 32 | $scope.close = function () { 33 | $uibModalInstance.dismiss(); 34 | }; 35 | 36 | $scope.copy = function () { 37 | Utils.success("Configuration has been copied to clipboard."); 38 | $uibModalInstance.dismiss(); 39 | }; 40 | 41 | }); 42 | } 43 | )(); 44 | -------------------------------------------------------------------------------- /dapp/src/controllers/importWalletConfigCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("importWalletConfigCtrl", function ($rootScope, $scope, $uibModalInstance, Utils, Wallet) { 6 | 7 | $scope.configuration = ""; 8 | 9 | /** 10 | * Loads a JSON script containing the wallets configuration 11 | */ 12 | $scope.load = function () { 13 | if($scope.configuration && $scope.configuration.trim() !== ""){ 14 | // Setting up new configuration 15 | try { 16 | Wallet.import($scope.configuration); 17 | // Show success message 18 | Utils.success("Configuration imported successfully."); 19 | 20 | $scope.close(); 21 | } catch (err) { 22 | // An error occurred 23 | Utils.dangerAlert("Please provide a valid JSON configuration script."); 24 | } 25 | 26 | try { 27 | $rootScope.$digest(); 28 | } 29 | catch (e) {} 30 | 31 | } else { 32 | Utils.dangerAlert("Please provide a valid JSON configuration script."); 33 | } 34 | }; 35 | 36 | /** 37 | * Close the modal instance 38 | */ 39 | $scope.close = function () { 40 | $uibModalInstance.dismiss(); 41 | }; 42 | 43 | }); 44 | } 45 | )(); 46 | -------------------------------------------------------------------------------- /dapp/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding-top: @jumbotron-padding; 8 | padding-bottom: @jumbotron-padding; 9 | margin-bottom: @jumbotron-padding; 10 | color: @jumbotron-color; 11 | background-color: @jumbotron-bg; 12 | 13 | h1, 14 | .h1 { 15 | color: @jumbotron-heading-color; 16 | } 17 | 18 | p { 19 | margin-bottom: (@jumbotron-padding / 2); 20 | font-size: @jumbotron-font-size; 21 | font-weight: 200; 22 | } 23 | 24 | > hr { 25 | border-top-color: darken(@jumbotron-bg, 10%); 26 | } 27 | 28 | .container &, 29 | .container-fluid & { 30 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 31 | padding-left: (@grid-gutter-width / 2); 32 | padding-right: (@grid-gutter-width / 2); 33 | } 34 | 35 | .container { 36 | max-width: 100%; 37 | } 38 | 39 | @media screen and (min-width: @screen-sm-min) { 40 | padding-top: (@jumbotron-padding * 1.6); 41 | padding-bottom: (@jumbotron-padding * 1.6); 42 | 43 | .container &, 44 | .container-fluid & { 45 | padding-left: (@jumbotron-padding * 2); 46 | padding-right: (@jumbotron-padding * 2); 47 | } 48 | 49 | h1, 50 | .h1 { 51 | font-size: @jumbotron-heading-font-size; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/selectAddressFromBook.html: -------------------------------------------------------------------------------- 1 | 6 | 42 | 47 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | platform: 2 | - x64 3 | 4 | # branches to build 5 | branches: 6 | # whitelist 7 | only: 8 | - master 9 | - develop 10 | 11 | skip_tags: true 12 | 13 | # Maximum number of concurrent jobs for the project 14 | max_jobs: 1 15 | 16 | # set clone depth 17 | clone_depth: 5 # clone entire repository history if not defined 18 | 19 | # to run your custom scripts instead of automatic tests 20 | # test_script: 21 | # - npm run test-dapp 22 | # - npm run test 23 | 24 | # scripts that run after cloning repository 25 | install: 26 | - ps: Install-Product node 8 x64 27 | - ps: $env:DEBUG = "electron-builder" 28 | - npm i -g --production windows-build-tools 29 | - cd dapp && rm -rf node_modules && rm package-lock.json && yarn config set msvs_version 2015 --global && yarn add secp256k1 && yarn add sha3 && yarn install && cd .. 30 | 31 | # to run your custom scripts instead of automatic MSBuild 32 | build_script: 33 | - cd dapp/ && mkdir dist && yarn build-libs-electron && yarn build-win 34 | 35 | # scripts to run before deployment 36 | after_build: 37 | - chmod +x prepare_deploy_win.sh 38 | - prepare_deploy_win.sh 39 | - cp dapp/dist/*.exe . 40 | 41 | artifacts: 42 | path: '*.exe' 43 | name: exe 44 | 45 | deploy: 46 | provider: S3 47 | access_key_id: $(AWS_ACCESS_KEY_ID) 48 | secret_access_key: $(AWS_SECRET_ACCESS_KEY) 49 | bucket: $(BUCKET_NAME) 50 | region: $(AWS_REGION) 51 | artifact: "exe" 52 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/configureGas.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 23 | 31 |
-------------------------------------------------------------------------------- /dapp/src/controllers/nonceCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("nonceCtrl", function (Web3Service, $scope, Utils, $uibModal, $uibModalInstance) { 6 | 7 | $scope.ok = function () { 8 | Web3Service.web3.eth.getTransactionCount( 9 | $scope.address, 10 | function (e, count) { 11 | if (e) { 12 | Utils.dangerAlert(e); 13 | } 14 | else { 15 | // Close 1st getNonce modal 16 | $uibModalInstance.dismiss(); 17 | 18 | $uibModal.open({ 19 | animation: false, 20 | templateUrl: 'partials/modals/showNonce.html', 21 | size: 'md', 22 | controller: function ($scope, $uibModalInstance, Utils) { 23 | $scope.nonce = count; 24 | 25 | $scope.copy = function () { 26 | Utils.success("Nonce has been copied to clipboard."); 27 | $uibModalInstance.dismiss(); 28 | }; 29 | 30 | $scope.cancel = function () { 31 | $uibModalInstance.dismiss(); 32 | }; 33 | 34 | } 35 | }); 36 | } 37 | } 38 | ); 39 | }; 40 | 41 | $scope.cancel = function () { 42 | $uibModalInstance.dismiss(); 43 | }; 44 | 45 | }); 46 | } 47 | )(); 48 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/disclaimerElectron.html: -------------------------------------------------------------------------------- 1 | 6 | 33 | 38 | -------------------------------------------------------------------------------- /dapp/src/controllers/replaceOwnerCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("replaceOwnerCtrl", function ($scope, Web3Service, Wallet, Utils, Transaction, wallet, owner, $uibModalInstance) { 6 | $scope.owner = owner; 7 | $scope.send = function () { 8 | // Convert owner address to checksum address 9 | $scope.newOwner = Web3Service.toChecksumAddress($scope.newOwner); 10 | 11 | Wallet.replaceOwner(wallet.address, $scope.owner.address, $scope.newOwner, {onlySimulate: false}, function (e, tx) { 12 | if (e) { 13 | Utils.dangerAlert(e); 14 | } 15 | else { 16 | wallet.owners[$scope.newOwner] = { 17 | name: wallet.owners[$scope.owner.address].name, 18 | address: $scope.newOwner 19 | }; 20 | delete wallet.owners[$scope.owner.address]; 21 | 22 | // Update owners array 23 | Wallet.updateWallet(wallet); 24 | Utils.notification("Replace owner transaction was sent."); 25 | Transaction.add({txHash: tx, callback: function (){ 26 | Utils.success("Replace owner transaction was mined."); 27 | }}); 28 | $uibModalInstance.close(); 29 | } 30 | }); 31 | }; 32 | 33 | $scope.cancel = function () { 34 | $uibModalInstance.dismiss(); 35 | }; 36 | 37 | }); 38 | } 39 | )(); 40 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/askLightWalletPassword.html: -------------------------------------------------------------------------------- 1 | 6 | 23 | 24 | 41 | -------------------------------------------------------------------------------- /dapp/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: middle; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /dapp/src/routes.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module('multiSigWeb') 5 | .config(function($routeProvider, NotificationProvider){ 6 | $routeProvider 7 | .when("/wallets", { 8 | controller: 'walletCtrl', 9 | templateUrl: 'partials/wallets.html' 10 | }) 11 | .when("/transactions", { 12 | controller: 'transactionCtrl', 13 | templateUrl: 'partials/transactions.html' 14 | }) 15 | .when("/wallet/:address", { 16 | controller: 'walletDetailCtrl', 17 | templateUrl: 'partials/wallet.html' 18 | }) 19 | .when("/settings", { 20 | controller: 'settingsCtrl', 21 | templateUrl: 'partials/settings.html' 22 | }) 23 | .when("/signup", { 24 | controller: 'notificationsSignupConfirmationCtrl', 25 | templateUrl: 'partials/wallets.html' 26 | }) 27 | .when("/accounts", { 28 | // Only for Electron 29 | controller: 'accountCtrl', 30 | templateUrl: 'partials/accounts.html' 31 | }) 32 | .when("/address-book", { 33 | controller: 'addressBookCtrl', 34 | templateUrl: 'partials/addressBook.html' 35 | }) 36 | .when("/404", { 37 | templateUrl: 'partials/404.html' 38 | }) 39 | .otherwise({ 40 | redirectTo: '/wallets' 41 | }); 42 | 43 | NotificationProvider.setOptions({ 44 | delay: 3000, 45 | horizontalSpacing: 60 46 | }); 47 | }); 48 | } 49 | )(); 50 | -------------------------------------------------------------------------------- /dapp/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // Core variables and mixins 8 | @import "variables.less"; 9 | @import "mixins.less"; 10 | 11 | // Reset and dependencies 12 | @import "normalize.less"; 13 | @import "print.less"; 14 | @import "glyphicons.less"; 15 | 16 | // Core CSS 17 | @import "scaffolding.less"; 18 | @import "type.less"; 19 | @import "code.less"; 20 | @import "grid.less"; 21 | @import "tables.less"; 22 | @import "forms.less"; 23 | @import "buttons.less"; 24 | 25 | // Components 26 | @import "component-animations.less"; 27 | @import "dropdowns.less"; 28 | @import "button-groups.less"; 29 | @import "input-groups.less"; 30 | @import "navs.less"; 31 | @import "navbar.less"; 32 | @import "breadcrumbs.less"; 33 | @import "pagination.less"; 34 | @import "pager.less"; 35 | @import "labels.less"; 36 | @import "badges.less"; 37 | @import "jumbotron.less"; 38 | @import "thumbnails.less"; 39 | @import "alerts.less"; 40 | @import "progress-bars.less"; 41 | @import "media.less"; 42 | @import "list-group.less"; 43 | @import "panels.less"; 44 | @import "responsive-embed.less"; 45 | @import "wells.less"; 46 | @import "close.less"; 47 | 48 | // Components w/ JavaScript 49 | @import "modals.less"; 50 | @import "tooltip.less"; 51 | @import "popovers.less"; 52 | @import "carousel.less"; 53 | 54 | // Utility classes 55 | @import "utilities.less"; 56 | @import "responsive-utilities.less"; 57 | -------------------------------------------------------------------------------- /dapp/src/controllers/confirmMultisigTransactionOfflineCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("confirmMultisigTransactionOfflineCtrl", function ($scope, address, Wallet, $uibModalInstance, Utils) { 6 | 7 | $scope.transactionId = null; 8 | 9 | $scope.signOffline = function () { 10 | Wallet.confirmTransactionOffline(address, $scope.transactionId, function (e, tx){ 11 | if (e) { 12 | Utils.dangerAlert(e); 13 | } 14 | else { 15 | Utils.signed(tx); 16 | $uibModalInstance.close(); 17 | } 18 | }); 19 | }; 20 | 21 | $scope.revokeOffline = function () { 22 | 23 | Wallet.revokeConfirmationOffline(address, $scope.transactionId, function (e, tx) { 24 | if (e) { 25 | Utils.dangerAlert(e); 26 | } 27 | else{ 28 | Utils.signed(tx); 29 | $uibModalInstance.close(); 30 | } 31 | }); 32 | 33 | }; 34 | 35 | $scope.executeOffline = function () { 36 | 37 | Wallet.executeTransactionOffline(address, $scope.transactionId, function (e, tx) { 38 | if (e) { 39 | Utils.dangerAlert(e); 40 | } 41 | else{ 42 | Utils.signed(tx); 43 | $uibModalInstance.close(); 44 | } 45 | }); 46 | 47 | }; 48 | 49 | $scope.cancel = function () { 50 | $uibModalInstance.dismiss(); 51 | }; 52 | }); 53 | } 54 | )(); 55 | -------------------------------------------------------------------------------- /dapp/src/services/ABI.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .service("ABI", function () { 6 | var factory = { 7 | saved: JSON.parse(localStorage.getItem("abis")) || {}, 8 | }; 9 | 10 | factory.get = function () { 11 | return JSON.parse(localStorage.getItem("abis")) || {}; 12 | }; 13 | 14 | factory.update = function (abi, to, name) { 15 | abiDecoder.addABI(abi); 16 | factory.saved[to] = { abi: abi, name: name}; 17 | 18 | localStorage.setItem("abis", JSON.stringify(factory.saved)); 19 | }; 20 | 21 | factory.remove = function (to) { 22 | abiDecoder.removeABI(factory.saved[to].abi); 23 | delete factory.saved[to]; 24 | localStorage.setItem("abis", JSON.stringify(factory.saved)); 25 | }; 26 | 27 | factory.decode = function (data) { 28 | var decoded = abiDecoder.decodeMethod(data); 29 | if (!decoded) { 30 | if (data.length > 20) { 31 | return { 32 | title: data.slice(0, 20) + "...", 33 | notDecoded: true 34 | }; 35 | } 36 | else { 37 | return { 38 | title: data.slice(0, 20), 39 | notDecoded: true 40 | }; 41 | } 42 | } 43 | else { 44 | return { 45 | title: decoded.name, 46 | params: decoded.params 47 | }; 48 | } 49 | }; 50 | 51 | return factory; 52 | }); 53 | } 54 | )(); 55 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/editToken.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 26 | 36 |
37 | -------------------------------------------------------------------------------- /dapp/src/controllers/editABICtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("editABICtrl", function ($scope, to, ABI, cb, Utils, $uibModalInstance) { 6 | var abis = ABI.get(); 7 | if (abis[to]) { 8 | var abiObject = abis[to]; 9 | $scope.abi = JSON.stringify(abiObject.abi); 10 | $scope.name = abiObject.name; 11 | } 12 | else { 13 | $scope.abi = ""; 14 | $scope.name = ""; 15 | } 16 | 17 | $scope.cancel = function () { 18 | $uibModalInstance.dismiss(); 19 | }; 20 | 21 | $scope.ok = function () { 22 | var executeChanges = true; 23 | var remove = false; 24 | 25 | try { 26 | if ($scope.abi !== undefined && $scope.abi.length > 0) { 27 | var parsedABI = JSON.parse($scope.abi); 28 | } 29 | else { 30 | remove = true; 31 | } 32 | } 33 | catch (e) { 34 | Utils.dangerAlert(e); 35 | executeChanges = false; 36 | } 37 | 38 | if (executeChanges) { 39 | if (remove) { 40 | if ($scope.name) { 41 | ABI.update(undefined, to, $scope.name); 42 | } 43 | else { 44 | ABI.remove(to); 45 | } 46 | } 47 | else { 48 | ABI.update(parsedABI, to, $scope.name); 49 | } 50 | 51 | $uibModalInstance.close(); 52 | cb(); 53 | 54 | } 55 | }; 56 | 57 | }); 58 | } 59 | )(); 60 | -------------------------------------------------------------------------------- /dapp/src/controllers/executeTransactionCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("executeTransactionCtrl", function ($scope, txId, address, Wallet, Transaction, $uibModalInstance, Utils){ 6 | $scope.send = function () { 7 | Wallet.executeTransaction(address, txId, {onlySimulate: false}, function (e, tx) { 8 | if (e) { 9 | Utils.dangerAlert(e); 10 | } 11 | else { 12 | Utils.notification("Execution transaction was sent."); 13 | Transaction.add({txHash: tx, callback: function (){ 14 | Utils.success("Execution transaction was mined."); 15 | }}); 16 | $uibModalInstance.close(); 17 | } 18 | }); 19 | }; 20 | 21 | $scope.simulate = function () { 22 | Wallet.executeTransaction(address, txId, {onlySimulate: true}, function (e, tx) { 23 | if (e) { 24 | Utils.dangerAlert(e); 25 | } 26 | else { 27 | Utils.simulatedTransaction(tx); 28 | } 29 | }); 30 | }; 31 | 32 | $scope.sign = function () { 33 | Wallet.executeTransactionOffline(address, txId, function (e, tx) { 34 | if (e) { 35 | Utils.dangerAlert(e); 36 | } 37 | else { 38 | Utils.signed(tx); 39 | $uibModalInstance.close(); 40 | } 41 | }); 42 | }; 43 | 44 | $scope.cancel = function () { 45 | $uibModalInstance.dismiss(); 46 | }; 47 | }); 48 | } 49 | )(); 50 | -------------------------------------------------------------------------------- /dapp/src/services/CommunicationBus.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .service("CommunicationBus", function ($interval) { 6 | var factory = { 7 | functions: {}, 8 | intervals: {} 9 | }; 10 | 11 | /** 12 | * Add a function to the list of available functions. 13 | * @param fn {Function} 14 | * @param index {String} - The name of the function normally 15 | */ 16 | factory.addFn = function (fn, index) { 17 | factory.functions[index] = fn; 18 | return index; 19 | }; 20 | 21 | /** 22 | * Set the Angular $interval for a function at a given index 23 | * @param index - Function identifier 24 | * @param millis - Timeout interval in milliseconds 25 | */ 26 | factory.startInterval = function (index, millis) { 27 | if (!factory.intervals[index]) { 28 | factory.intervals[index] = $interval(factory.functions[index], millis); 29 | } 30 | }; 31 | 32 | /** 33 | * Stop an existing $interval 34 | * @param index - Function identifier 35 | */ 36 | factory.stopInterval = function (index) { 37 | if (factory.intervals[index]) { 38 | $interval.cancel(factory.intervals[index]); 39 | delete factory.intervals[index]; 40 | } 41 | }; 42 | 43 | /** 44 | * Retrieve a function 45 | * @param index - Function identifier 46 | */ 47 | factory.getFn = function (index) { 48 | return factory.functions[index]; 49 | }; 50 | 51 | return factory; 52 | }); 53 | } 54 | )(); 55 | -------------------------------------------------------------------------------- /dapp/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /dapp/src/controllers/depositCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("depositCtrl", function ($scope, Transaction, $uibModalInstance, Wallet, Utils, wallet, Web3Service) { 6 | $scope.wallet = wallet; 7 | $scope.amount = 10; 8 | $scope.deposit = function () { 9 | Transaction.send( 10 | { 11 | to: $scope.wallet.address, 12 | from: Web3Service.coinbase, 13 | value: new ethereumjs.BN(new Web3().toWei($scope.amount)), 14 | gas: 50000, 15 | gasPrice: Wallet.txParams.gasPrice 16 | }, 17 | function (e, tx) { 18 | if (e) { 19 | Utils.dangerAlert(e); 20 | } 21 | else if (tx.blockNumber) { 22 | Utils.success("Deposit transaction was mined."); 23 | } 24 | else { 25 | Utils.notification("Deposit transaction was sent."); 26 | $uibModalInstance.close(); 27 | } 28 | } 29 | ); 30 | }; 31 | 32 | $scope.sign = function () { 33 | Transaction.signOffline( 34 | { 35 | to: $scope.wallet.address, 36 | value: new ethereumjs.BN(new Web3().toWei($scope.amount)) 37 | }, 38 | function (e, signed) { 39 | if (e) { 40 | Utils.dangerAlert(e); 41 | } 42 | else { 43 | $uibModalInstance.close(); 44 | Utils.signed(signed); 45 | } 46 | }); 47 | }; 48 | 49 | $scope.cancel = function () { 50 | $uibModalInstance.dismiss(); 51 | }; 52 | }); 53 | } 54 | )(); 55 | -------------------------------------------------------------------------------- /dapp/less/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: @color; 14 | background-color: darken(@background, 10%); 15 | border-color: darken(@border, 25%); 16 | } 17 | &:hover { 18 | color: @color; 19 | background-color: darken(@background, 10%); 20 | border-color: darken(@border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > .dropdown-toggle& { 25 | color: @color; 26 | background-color: darken(@background, 10%); 27 | border-color: darken(@border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: @color; 33 | background-color: darken(@background, 17%); 34 | border-color: darken(@border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > .dropdown-toggle& { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &:hover, 46 | &:focus, 47 | &.focus { 48 | background-color: @background; 49 | border-color: @border; 50 | } 51 | } 52 | 53 | .badge { 54 | color: @background; 55 | background-color: @color; 56 | } 57 | } 58 | 59 | // Button sizes 60 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 61 | padding: @padding-vertical @padding-horizontal; 62 | font-size: @font-size; 63 | line-height: @line-height; 64 | border-radius: @border-radius; 65 | } 66 | -------------------------------------------------------------------------------- /dapp/less/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '9' 4 | matrix: 5 | include: 6 | - os: linux 7 | dist: trusty 8 | sudo: required 9 | env: 10 | - DIST='web' # distribution 11 | - os: linux 12 | dist: trusty 13 | sudo: required 14 | env: 15 | - DIST='desktop' 16 | - os: osx 17 | env: 18 | - DIST='desktop' 19 | before_install: 20 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev ; fi 21 | - export CHROME_BIN=chromium-browser 22 | - export DISPLAY=:99.0 23 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start ; fi 24 | install: npm install && cd dapp && npm install && cd .. 25 | script: 26 | - npm run test-dapp 27 | - npm run test 28 | before_deploy: 29 | - chmod +x prepare_deploy_linux.sh 30 | - ./prepare_deploy_linux.sh 31 | deploy: 32 | - provider: s3 33 | bucket: wallet-development 34 | access_key_id: $AWS_ACCESS_KEY_ID 35 | secret_access_key: $AWS_SECRET_ACCESS_KEY 36 | skip_cleanup: true 37 | local_dir: dapp/src 38 | on: 39 | branch: develop 40 | condition: $DIST = web 41 | - provider: s3 42 | bucket: wallet-staging 43 | access_key_id: $AWS_ACCESS_KEY_ID 44 | secret_access_key: $AWS_SECRET_ACCESS_KEY 45 | skip_cleanup: true 46 | local_dir: dapp/src 47 | on: 48 | branch: master 49 | condition: $DIST = web 50 | 51 | - provider: s3 52 | bucket: wallet-desktop-builds 53 | access_key_id: $AWS_ACCESS_KEY_ID 54 | secret_access_key: $AWS_SECRET_ACCESS_KEY 55 | skip_cleanup: true 56 | local_dir: $TRAVIS_BUILD_DIR/dapp/dist/ 57 | on: 58 | branch: develop # remember to change it to master 59 | condition: $DIST = 'desktop' 60 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/ledgerHelp.html: -------------------------------------------------------------------------------- 1 | 8 | 50 | 55 | -------------------------------------------------------------------------------- /dapp/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /dapp/src/controllers/removeOwnerCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("removeOwnerCtrl", function ($scope, Wallet, Utils, Transaction, wallet, owner, $uibModalInstance) { 6 | $scope.owner = owner; 7 | $scope.send = function () { 8 | Wallet.removeOwner(wallet.address, $scope.owner, {onlySimulate: false}, function (e, tx) { 9 | if (e) { 10 | Utils.dangerAlert(e); 11 | } 12 | else { 13 | // Update owners array 14 | Wallet.updateWallet(wallet); 15 | Utils.notification("Remove owner transaction was sent."); 16 | Transaction.add({txHash: tx, callback: function (){ 17 | Utils.success("Remove owner transaction was mined."); 18 | }}); 19 | $uibModalInstance.close(); 20 | } 21 | }); 22 | }; 23 | 24 | $scope.simulate = function () { 25 | Wallet.removeOwner(wallet.address, $scope.owner, {onlySimulate: true}, function (e, tx) { 26 | if (e) { 27 | Utils.dangerAlert(e); 28 | } 29 | else { 30 | Utils.simulatedTransaction(tx); 31 | } 32 | }); 33 | }; 34 | 35 | $scope.getNonce = function () { 36 | var data = Wallet.getRemoveOwnerData(wallet.address, $scope.owner); 37 | Wallet.getNonce(wallet.address, wallet.address, "0x0", data, function (e, nonce) { 38 | if (e) { 39 | Utils.dangerAlert(e); 40 | } 41 | else { 42 | // Open modal 43 | $uibModalInstance.close(); 44 | Utils.nonce(nonce); 45 | } 46 | }).call(); 47 | }; 48 | 49 | $scope.cancel = function () { 50 | $uibModalInstance.dismiss(); 51 | }; 52 | 53 | }); 54 | } 55 | )(); 56 | -------------------------------------------------------------------------------- /dapp/src/partials/addressBook.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 7 |
8 |

9 | Address book 10 |

11 |
12 | 13 | 14 | 15 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | 39 | 49 | 52 | 53 | 54 |
16 | Name 17 | 19 | Address 20 | 22 | Type 23 |
29 | {{ book.name }} 30 |
31 | 34 | 37 |
38 |
40 |
41 | {{::book.address|address}} 42 | 47 |
48 |
50 | {{ book.type }} 51 |
55 |
56 | No addresses. Add a new entry now. 57 |
58 |
59 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/disclaimer.html: -------------------------------------------------------------------------------- 1 | 6 | 40 | 45 | -------------------------------------------------------------------------------- /dapp/src/controllers/updateRequiredCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("updateRequiredCtrl", function ($scope, Wallet, Transaction, Utils, $uibModalInstance, wallet) { 6 | $scope.address = wallet.address; 7 | 8 | 9 | Wallet 10 | .getRequired($scope.address, function (e, required) { 11 | $scope.required = required.toNumber(); 12 | $scope.$apply(); 13 | }).call(); 14 | 15 | 16 | $scope.update = function () { 17 | Wallet.updateRequired($scope.address, $scope.required, {onlySimulate: false}, function (e, tx) { 18 | if (e) { 19 | Utils.dangerAlert(e); 20 | } 21 | else { 22 | $uibModalInstance.close(); 23 | Utils.notification("Update required confirmations transaction was sent."); 24 | Transaction.add({txHash: tx, callback: function () { 25 | Utils.success("Update required confirmations transaction was mined."); 26 | }}); 27 | } 28 | }); 29 | }; 30 | 31 | $scope.signOffline = function () { 32 | Wallet.signUpdateRequired($scope.address, $scope.required, function (e, tx) { 33 | if (e) { 34 | Utils.dangerAlert(e); 35 | } 36 | else { 37 | $uibModalInstance.close(); 38 | Utils.signed(tx); 39 | } 40 | }); 41 | }; 42 | 43 | $scope.getNonce = function () { 44 | var data = Wallet.getUpdateRequiredData($scope.address, $scope.required); 45 | Wallet.getNonce($scope.address, $scope.address, "0x0", data, function (e, nonce) { 46 | // Open modal 47 | $uibModalInstance.close(); 48 | Utils.nonce(nonce); 49 | }).call(); 50 | }; 51 | 52 | $scope.cancel = function () { 53 | $uibModalInstance.dismiss(); 54 | }; 55 | }); 56 | } 57 | )(); 58 | -------------------------------------------------------------------------------- /test/javascript/utils.js: -------------------------------------------------------------------------------- 1 | function getParamFromTxEvent(transaction, paramName, contractFactory, eventName) { 2 | assert.isObject(transaction) 3 | let logs = transaction.logs 4 | if(eventName != null) { 5 | logs = logs.filter((l) => l.event === eventName) 6 | } 7 | assert.equal(logs.length, 1, 'too many logs found!') 8 | let param = logs[0].args[paramName] 9 | if(contractFactory != null) { 10 | let contract = contractFactory.at(param) 11 | assert.isObject(contract, `getting ${paramName} failed for ${param}`) 12 | return contract 13 | } else { 14 | return param 15 | } 16 | } 17 | 18 | function mineBlock(web3, reject, resolve) { 19 | web3.currentProvider.sendAsync({ 20 | method: "evm_mine", 21 | jsonrpc: "2.0", 22 | id: new Date().getTime() 23 | }, (e) => (e ? reject(e) : resolve())) 24 | } 25 | 26 | function increaseTimestamp(web3, increase) { 27 | return new Promise((resolve, reject) => { 28 | web3.currentProvider.sendAsync({ 29 | method: "evm_increaseTime", 30 | params: [increase], 31 | jsonrpc: "2.0", 32 | id: new Date().getTime() 33 | }, (e) => (e ? reject(e) : mineBlock(web3, reject, resolve))) 34 | }) 35 | } 36 | 37 | function balanceOf(web3, account) { 38 | return new Promise((resolve, reject) => web3.eth.getBalance(account, (e, balance) => (e ? reject(e) : resolve(balance)))) 39 | } 40 | 41 | async function assertThrowsAsynchronously(test, error) { 42 | try { 43 | await test(); 44 | } catch(e) { 45 | if (!error || e instanceof error) 46 | return "everything is fine"; 47 | } 48 | throw new Error("Missing rejection" + (error ? " with "+error.name : "")); 49 | } 50 | 51 | Object.assign(exports, { 52 | getParamFromTxEvent, 53 | increaseTimestamp, 54 | balanceOf, 55 | assertThrowsAsynchronously, 56 | }) -------------------------------------------------------------------------------- /dapp/src/controllers/setLimitCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("setLimitCtrl", function ($scope, $uibModalInstance, Utils, Transaction, wallet, Wallet) { 6 | $scope.address = wallet.address; 7 | 8 | Wallet 9 | .getLimit($scope.address, function (e, required) { 10 | if (required ) { 11 | $scope.limit = required.div('1e18').toNumber(); 12 | $scope.$apply(); 13 | } 14 | }).call(); 15 | 16 | $scope.setLimit = function () { 17 | Wallet.updateLimit($scope.address, new Web3().toBigNumber($scope.limit).mul('1e18'), {onlySimulate: false}, function (e, tx){ 18 | if (e) { 19 | Utils.dangerAlert(e); 20 | } 21 | else { 22 | $uibModalInstance.close(); 23 | Utils.notification("Update daily limit transaction was sent."); 24 | Transaction.add({txHash: tx, callback: function () { 25 | Utils.success("Update daily limit transaction was mined."); 26 | }}); 27 | } 28 | }); 29 | }; 30 | 31 | $scope.sign = function () { 32 | Wallet.signLimit($scope.address, new Web3().toBigNumber($scope.limit).mul('1e18'), function (e, tx) { 33 | if (e) { 34 | Utils.dangerAlert(e); 35 | } 36 | else { 37 | $uibModalInstance.close(); 38 | Utils.signed(tx); 39 | } 40 | }); 41 | }; 42 | 43 | $scope.getNonce = function () { 44 | var data = Wallet.getUpdateLimitData($scope.address, new Web3().toBigNumber($scope.limit).mul('1e18')); 45 | Wallet.getNonce($scope.address, $scope.address, "0x0", data, function (e, nonce) { 46 | // Open modal 47 | $uibModalInstance.close(); 48 | Utils.nonce(nonce); 49 | }).call(); 50 | }; 51 | 52 | $scope.cancel = function () { 53 | $uibModalInstance.dismiss(); 54 | }; 55 | }); 56 | } 57 | )(); 58 | -------------------------------------------------------------------------------- /dapp/src/controllers/withdrawLimitCtrl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This controller manages submit new multisig transaction under daily limit 3 | * using submitTransaction function. 4 | */ 5 | ( 6 | function () { 7 | angular 8 | .module("multiSigWeb") 9 | .controller("withdrawLimitCtrl", function ($scope, Wallet, Transaction, Utils, wallet, $uibModalInstance, Web3Service) { 10 | 11 | $scope.wallet = wallet; 12 | $scope.tx = { 13 | value: 0, 14 | to: Web3Service.coinbase, 15 | data: '0x0' 16 | }; 17 | 18 | $scope.send = function () { 19 | var tx = {}; 20 | Object.assign(tx, $scope.tx); 21 | tx.value = new Web3().toBigNumber($scope.tx.value).mul('1e18'); 22 | 23 | Wallet.submitTransaction( 24 | $scope.wallet.address, 25 | tx, 26 | null, 27 | null, 28 | null, 29 | {onlySimulate: false}, 30 | function (e, tx) { 31 | if (e) { 32 | Utils.dangerAlert(e); 33 | } 34 | else { 35 | Utils.notification("Multisig transaction was sent."); 36 | Transaction.add( 37 | { 38 | txHash: tx, 39 | callback: function () { 40 | Utils.success("Multisig transaction was mined"); 41 | } 42 | } 43 | ); 44 | $uibModalInstance.close(); 45 | } 46 | } 47 | ); 48 | }; 49 | 50 | $scope.signOff = function () { 51 | var tx = {}; 52 | Object.assign(tx, $scope.tx); 53 | tx.value = new Web3().toBigNumber($scope.tx.value).mul('1e18'); 54 | 55 | Wallet.signTransaction( 56 | $scope.wallet.address, 57 | tx, 58 | null, 59 | null, 60 | null, 61 | function (e, tx) { 62 | if (e) { 63 | Utils.dangerAlert(e); 64 | } 65 | else{ 66 | $uibModalInstance.close(); 67 | Utils.signed(tx); 68 | } 69 | } 70 | ); 71 | }; 72 | 73 | $scope.cancel = function () { 74 | $uibModalInstance.dismiss(); 75 | }; 76 | }); 77 | } 78 | )(); 79 | -------------------------------------------------------------------------------- /dapp/less/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /dapp/src/controllers/depositTokenCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("depositTokenCtrl", function ($scope, Transaction, Token, $uibModalInstance, Utils, wallet, token) { 6 | $scope.wallet = wallet; 7 | $scope.token = token; 8 | $scope.amount = 10; 9 | $scope.deposit = function () { 10 | Token.transfer( 11 | $scope.token.address, 12 | $scope.wallet.address, 13 | new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals), 14 | {onlySimulate: false}, 15 | function(e, tx){ 16 | if (e) { 17 | Utils.dangerAlert(e); 18 | } 19 | else { 20 | Utils.notification("Deposit transaction was sent."); 21 | $uibModalInstance.close(); 22 | Transaction.add({ 23 | txHash: tx, 24 | callback: function () { 25 | Utils.success("Deposit transaction was mined."); 26 | } 27 | }); 28 | } 29 | } 30 | ); 31 | }; 32 | 33 | $scope.simulate = function () { 34 | Token.transfer( 35 | $scope.token.address, 36 | $scope.wallet.address, 37 | new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals), 38 | {onlySimulate: true}, 39 | function(e, tx){ 40 | if (e) { 41 | Utils.dangerAlert(e); 42 | } 43 | else { 44 | Utils.simulatedTransaction(tx); 45 | } 46 | } 47 | ); 48 | }; 49 | 50 | $scope.sign = function () { 51 | Token.transferOffline( 52 | $scope.token.address, 53 | $scope.wallet.address, 54 | new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals), 55 | function(e, signed){ 56 | if (e) { 57 | Utils.dangerAlert(e); 58 | } 59 | else { 60 | $uibModalInstance.close(); 61 | Utils.signed(signed); 62 | } 63 | } 64 | ); 65 | }; 66 | 67 | $scope.cancel = function () { 68 | $uibModalInstance.dismiss(); 69 | }; 70 | }); 71 | } 72 | )(); 73 | -------------------------------------------------------------------------------- /dapp/src/partials/accounts.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 9 | 14 |
15 |

16 | Accounts 17 |

18 |
19 | 20 | 21 | 22 | 25 | 28 | 29 | 30 | 31 | 32 | 43 | 58 | 59 | 60 |
23 | Name 24 | 26 | Address 27 |
33 | 34 |
35 | 38 | 41 |
42 |
44 | 45 | {{account.address}} 46 | 47 |
48 | 53 | 56 |
57 |
61 |
62 | No accounts. Add an account now. 63 |
64 |
65 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/safeMigration.html: -------------------------------------------------------------------------------- 1 | 6 | 56 | 62 | -------------------------------------------------------------------------------- /dapp/src/controllers/signedTransactionCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("signedTransactionCtrl", function (Web3Service, $scope, Wallet, Utils, Transaction, $uibModalInstance) { 6 | $scope.sendRawTransaction = function () { 7 | Transaction.sendRawTransaction($scope.tx, function (e, txHash) { 8 | if (e) { 9 | Utils.dangerAlert(e); 10 | } 11 | else { 12 | $uibModalInstance.close(); 13 | Utils.notification("Transaction was sent."); 14 | // Wait for transaction receipt to get contract address 15 | Transaction.add({txHash: txHash, callback: function (receipt) { 16 | 17 | if (receipt.contractAddress) { 18 | Web3Service.web3.eth.getCode(receipt.contractAddress, function (e, code){ 19 | if (code.length > 100 && Wallet.json.multiSigDailyLimit.binHex.slice(-992) == code.slice(-992)){ 20 | Utils.success("Wallet deployed at address: " + receipt.contractAddress); 21 | Wallet.updateWallet({name: "Offline wallet", address: receipt.contractAddress, owners: {}}); 22 | Transaction.update(txHash, {multisig: receipt.contractAddress}); 23 | } 24 | else { 25 | Utils.success("Contract deployed at address: " + receipt.contractAddress); 26 | } 27 | }); 28 | } 29 | else if( receipt.decodedLogs.length && receipt.decodedLogs[0] && receipt.decodedLogs[0].events && receipt.decodedLogs[0].events.length > 1 && receipt.decodedLogs[0].events[1].name == "instantiation"){ 30 | var walletAddress = receipt.decodedLogs[0].events[1].value; 31 | Utils.success("Wallet deployed at address:" + walletAddress); 32 | Wallet.updateWallet({name: "Factory wallet", address: walletAddress, owners: {}}); 33 | Transaction.update(txHash, {multisig: walletAddress}); 34 | } 35 | else { 36 | Utils.success("Transaction was mined."); 37 | } 38 | }}); 39 | 40 | } 41 | }); 42 | }; 43 | 44 | $scope.cancel = function () { 45 | $uibModalInstance.dismiss(); 46 | }; 47 | }); 48 | } 49 | )(); 50 | -------------------------------------------------------------------------------- /dapp/src/controllers/addTokenCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("addTokenCtrl", function (Web3Service, $scope, $uibModalInstance, Wallet, Token, token, wallet) { 6 | 7 | $scope.wallet = wallet; 8 | 9 | if (!$scope.wallet.tokens) { 10 | $scope.wallet.tokens = {}; 11 | } 12 | 13 | if (Object.keys(token).length) { 14 | $scope.editMode = true; 15 | token.address = Web3Service.toChecksumAddress(token.address); 16 | } 17 | 18 | $scope.editToken = {}; // Used for editing data 19 | $scope.token = token; 20 | Object.assign($scope.editToken, $scope.token); 21 | 22 | // Refresh token info when address changes 23 | $scope.updateInfo = function () { 24 | var batchInfo = Web3Service.web3.createBatch(); 25 | 26 | batchInfo.add( 27 | Token.name( 28 | $scope.editToken.address, 29 | function (e, name) { 30 | if (!e) { 31 | $scope.editToken.name = name; 32 | $scope.$apply(); 33 | } 34 | } 35 | ) 36 | ); 37 | 38 | batchInfo.add( 39 | Token.symbol( 40 | $scope.editToken.address, 41 | function (e, symbol) { 42 | if (!e) { 43 | $scope.editToken.symbol = symbol; 44 | $scope.$apply(); 45 | } 46 | } 47 | ) 48 | ); 49 | 50 | batchInfo.add( 51 | Token.decimals( 52 | $scope.editToken.address, 53 | function (e, decimals) { 54 | if (!e) { 55 | $scope.editToken.decimals = decimals.toNumber(); 56 | $scope.$apply(); 57 | } 58 | } 59 | ) 60 | ); 61 | 62 | batchInfo.execute(); 63 | }; 64 | 65 | $scope.ok = function () { 66 | // Convert token address to checksum address 67 | $scope.editToken.address = Web3Service.toChecksumAddress($scope.editToken.address); 68 | 69 | $scope.wallet.tokens[$scope.editToken.address] = $scope.editToken; 70 | Wallet.updateWallet($scope.wallet); 71 | $uibModalInstance.close(); 72 | }; 73 | 74 | $scope.cancel = function () { 75 | $uibModalInstance.dismiss(); 76 | }; 77 | }); 78 | } 79 | )(); 80 | -------------------------------------------------------------------------------- /dapp/less/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | z-index: 2; 44 | color: @pagination-hover-color; 45 | background-color: @pagination-hover-bg; 46 | border-color: @pagination-hover-border; 47 | } 48 | } 49 | 50 | > .active > a, 51 | > .active > span { 52 | &, 53 | &:hover, 54 | &:focus { 55 | z-index: 3; 56 | color: @pagination-active-color; 57 | background-color: @pagination-active-bg; 58 | border-color: @pagination-active-border; 59 | cursor: default; 60 | } 61 | } 62 | 63 | > .disabled { 64 | > span, 65 | > span:hover, 66 | > span:focus, 67 | > a, 68 | > a:hover, 69 | > a:focus { 70 | color: @pagination-disabled-color; 71 | background-color: @pagination-disabled-bg; 72 | border-color: @pagination-disabled-border; 73 | cursor: @cursor-disabled; 74 | } 75 | } 76 | } 77 | 78 | // Sizing 79 | // -------------------------------------------------- 80 | 81 | // Large 82 | .pagination-lg { 83 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); 84 | } 85 | 86 | // Small 87 | .pagination-sm { 88 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); 89 | } 90 | -------------------------------------------------------------------------------- /dapp/src/controllers/withdrawTokenCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("withdrawTokenCtrl", function ($scope, Wallet, Token, Transaction, Utils, wallet, token, $uibModalInstance, Web3Service) { 6 | 7 | $scope.wallet = wallet; 8 | $scope.token = token; 9 | $scope.amount = 10; 10 | $scope.to = Web3Service.coinbase; 11 | 12 | $scope.send = function () { 13 | Token.withdraw( 14 | $scope.token.address, 15 | $scope.wallet.address, 16 | $scope.to, 17 | new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals), 18 | function (e, tx) { 19 | if (e) { 20 | Utils.dangerAlert(e); 21 | } 22 | else { 23 | Utils.notification("Withdraw token transaction was sent."); 24 | $uibModalInstance.close(); 25 | Transaction.add({ 26 | txHash: tx, 27 | callback: function () { 28 | Utils.success("Withdraw token transaction was mined."); 29 | } 30 | }); 31 | } 32 | } 33 | ); 34 | }; 35 | 36 | $scope.signOff = function () { 37 | Token.withdrawOffline( 38 | $scope.token.address, 39 | $scope.wallet.address, 40 | $scope.to, 41 | new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals), 42 | function (e, signed) { 43 | $uibModalInstance.close(); 44 | Utils.signed(signed); 45 | } 46 | ); 47 | }; 48 | 49 | $scope.getNonce = function () { 50 | var value = new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals); 51 | var data = Token.withdrawData( 52 | $scope.token.address, 53 | $scope.to, 54 | new Web3().toBigNumber($scope.amount).mul('1e' + $scope.token.decimals) 55 | ); 56 | Wallet.getNonce($scope.wallet.address, $scope.token.address, "0x0", data, function (e, nonce) { 57 | if (e) { 58 | Utils.dangerAlert(e); 59 | } 60 | else{ 61 | $uibModalInstance.close(); 62 | Utils.nonce(nonce); 63 | } 64 | }).call(); 65 | 66 | }; 67 | 68 | $scope.cancel = function () { 69 | $uibModalInstance.dismiss(); 70 | }; 71 | }); 72 | } 73 | )(); 74 | -------------------------------------------------------------------------------- /dapp/src/controllers/addOwnerCtrl.js: -------------------------------------------------------------------------------- 1 | ( 2 | function () { 3 | angular 4 | .module("multiSigWeb") 5 | .controller("addOwnerCtrl", function ($scope, Wallet, Utils, Transaction, wallet, $uibModalInstance) { 6 | $scope.send = function () { 7 | try{ 8 | Wallet.addOwner(wallet.address, $scope.owner, {onlySimulate: false}, function (e, tx) { 9 | if (e) { 10 | Utils.dangerAlert(e); 11 | } 12 | else { 13 | // Update owners array 14 | wallet.owners[$scope.owner.address] = $scope.owner; 15 | Wallet.updateWallet(wallet); 16 | Utils.notification("Add owner transaction was sent."); 17 | Transaction.add({txHash: tx, callback: function () { 18 | Utils.success("Add owner transaction was mined."); 19 | }}); 20 | $uibModalInstance.close(); 21 | } 22 | }); 23 | } catch (error) { 24 | Utils.dangerAlert(error); 25 | } 26 | }; 27 | 28 | $scope.simulate = function () { 29 | try{ 30 | Wallet.addOwner(wallet.address, $scope.owner, {onlySimulate: true}, function (e, tx) { 31 | if (e) { 32 | Utils.dangerAlert(e); 33 | } 34 | else { 35 | Utils.simulatedTransaction(tx); 36 | } 37 | }); 38 | } catch (error) { 39 | Utils.dangerAlert(error); 40 | } 41 | }; 42 | 43 | $scope.sign = function () { 44 | Wallet.addOwnerOffline(wallet.address, $scope.owner, function (e, tx) { 45 | if (e) { 46 | Utils.dangerAlert(e); 47 | } 48 | else { 49 | $uibModalInstance.close(); 50 | Utils.signed(tx); 51 | } 52 | }); 53 | }; 54 | 55 | $scope.getNonce = function () { 56 | var data = Wallet.getAddOwnerData(wallet.address, $scope.owner); 57 | Wallet.getNonce(wallet.address, wallet.address, "0x0", data, function (e, nonce) { 58 | if (e) { 59 | Utils.dangerAlert(e); 60 | } 61 | else { 62 | // Open modal 63 | $uibModalInstance.close(); 64 | Utils.nonce(nonce); 65 | } 66 | }).call(); 67 | }; 68 | 69 | $scope.cancel = function () { 70 | $uibModalInstance.dismiss(); 71 | }; 72 | 73 | }); 74 | } 75 | )(); 76 | -------------------------------------------------------------------------------- /dapp/less/print.less: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .btn, 76 | .dropup > .btn { 77 | > .caret { 78 | border-top-color: #000 !important; 79 | } 80 | } 81 | .label { 82 | border: 1px solid #000; 83 | } 84 | 85 | .table { 86 | border-collapse: collapse !important; 87 | 88 | td, 89 | th { 90 | background-color: #fff !important; 91 | } 92 | } 93 | .table-bordered { 94 | th, 95 | td { 96 | border: 1px solid #ddd !important; 97 | } 98 | } 99 | 100 | // Bootstrap specific changes end 101 | } 102 | -------------------------------------------------------------------------------- /dapp/src/partials/modals/importLightWalletAccount.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 47 | 64 |
65 | -------------------------------------------------------------------------------- /test/javascript/testExternalCallsWithDailyLimit.js: -------------------------------------------------------------------------------- 1 | const MultiSigWalletWithDailyLimit = artifacts.require('MultiSigWalletWithDailyLimit') 2 | const web3 = MultiSigWalletWithDailyLimit.web3 3 | const TestToken = artifacts.require('TestToken') 4 | const TestCalls = artifacts.require('TestCalls') 5 | 6 | const deployToken = () => { 7 | return TestToken.new() 8 | } 9 | const deployCalls = () => { 10 | return TestCalls.new() 11 | } 12 | 13 | const deployMultisig = (owners, confirmations, limit) => { 14 | return MultiSigWalletWithDailyLimit.new(owners, confirmations, limit) 15 | } 16 | 17 | const utils = require('./utils') 18 | const ONE_DAY = 24*3600 19 | 20 | contract('MultiSigWalletWithDailyLimit', (accounts) => { 21 | let multisigInstance 22 | const dailyLimit = 3000 23 | const requiredConfirmations = 2 24 | 25 | beforeEach(async () => { 26 | multisigInstance = await deployMultisig([accounts[0], accounts[1]], requiredConfirmations, dailyLimit) 27 | assert.ok(multisigInstance) 28 | tokenInstance = await deployToken() 29 | assert.ok(tokenInstance) 30 | callsInstance = await deployCalls() 31 | assert.ok(callsInstance) 32 | 33 | const deposit = 10000000 34 | 35 | // Send money to wallet contract 36 | await new Promise((resolve, reject) => web3.eth.sendTransaction({to: multisigInstance.address, value: deposit, from: accounts[0]}, e => (e ? reject(e) : resolve()))) 37 | const balance = await utils.balanceOf(web3, multisigInstance.address) 38 | assert.equal(balance.valueOf(), deposit) 39 | }) 40 | 41 | it('transferWithPayloadSizeCheck', async () => { 42 | // Issue tokens to the multisig address 43 | const issueResult = await tokenInstance.issueTokens(multisigInstance.address, 1000000, {from: accounts[0]}) 44 | assert.ok(issueResult) 45 | // Encode transfer call for the multisig 46 | const transferEncoded = tokenInstance.contract.transfer.getData(accounts[1], 1000000) 47 | const transactionId = utils.getParamFromTxEvent( 48 | await multisigInstance.submitTransaction(tokenInstance.address, 0, transferEncoded, {from: accounts[0]}), 49 | 'transactionId', null, 'Submission') 50 | 51 | const executedTransactionId = utils.getParamFromTxEvent( 52 | await multisigInstance.confirmTransaction(transactionId, {from: accounts[1]}), 53 | 'transactionId', null, 'Execution') 54 | // Check that transaction has been executed 55 | assert.ok(transactionId.equals(executedTransactionId)) 56 | // Check that the transfer has actually occured 57 | assert.equal( 58 | 1000000, 59 | await tokenInstance.balanceOf(accounts[1]) 60 | ) 61 | }) 62 | }) 63 | -------------------------------------------------------------------------------- /test/javascript/testMultiSigWalletWithDailyLimitFactory.js: -------------------------------------------------------------------------------- 1 | const MultiSigWalletWithDailyLimit = artifacts.require('MultiSigWalletWithDailyLimit') 2 | const MultiSigWalletWithDailyLimitFactory = artifacts.require('MultiSigWalletWithDailyLimitFactory') 3 | const web3 = MultiSigWalletWithDailyLimitFactory.web3 4 | 5 | const utils = require('./utils') 6 | 7 | contract('MultiSigWalletWithDailyLimitFactory', (accounts) => { 8 | let factoryInstance 9 | const dailyLimit = 3000 10 | const requiredConfirmations = 2 11 | 12 | beforeEach(async () => { 13 | // [accounts[0], accounts[1]], requiredConfirmations, dailyLimit 14 | factoryInstance = await MultiSigWalletWithDailyLimitFactory.new() 15 | assert.ok(factoryInstance) 16 | }) 17 | 18 | it('Multisig Factory', async () => { 19 | // Create factory 20 | const tx = await factoryInstance.create([accounts[0], accounts[1]], requiredConfirmations, dailyLimit) 21 | const walletAddress = utils.getParamFromTxEvent(tx, 'instantiation', null, 'ContractInstantiation') 22 | 23 | const walletCount = await factoryInstance.getInstantiationCount(accounts[0]) 24 | const multisigWalletAddressConfirmation = await factoryInstance.instantiations(accounts[0], walletCount.sub(1).toNumber()) 25 | assert.equal(walletAddress, multisigWalletAddressConfirmation) 26 | assert.ok(factoryInstance.isInstantiation(walletAddress)) 27 | 28 | // Send money to wallet contract 29 | const multisigInstance = MultiSigWalletWithDailyLimit.at(walletAddress) 30 | const deposit = 10000 31 | await new Promise((resolve, reject) => web3.eth.sendTransaction({to: walletAddress, value: deposit, from: accounts[0]}, e => (e ? reject(e) : resolve()))) 32 | const balance = await utils.balanceOf(web3, walletAddress) 33 | assert.equal(balance.valueOf(), deposit) 34 | assert.equal(dailyLimit, await multisigInstance.dailyLimit()) 35 | assert.equal(dailyLimit, await multisigInstance.calcMaxWithdraw()) 36 | 37 | // Update daily limit 38 | const dailyLimitUpdated = 2000 39 | const dailyLimitEncoded = multisigInstance.contract.changeDailyLimit.getData(dailyLimitUpdated) 40 | const transactionId = utils.getParamFromTxEvent( 41 | await multisigInstance.submitTransaction(multisigInstance.address, 0, dailyLimitEncoded, {from: accounts[0]}), 42 | 'transactionId', null, 'Submission' 43 | ) 44 | 45 | await multisigInstance.confirmTransaction(transactionId, {from: accounts[1]}) 46 | assert.equal(dailyLimitUpdated, (await multisigInstance.dailyLimit()).toNumber()) 47 | assert.equal(dailyLimitUpdated, (await multisigInstance.calcMaxWithdraw()).toNumber()) 48 | }) 49 | }) -------------------------------------------------------------------------------- /dapp/src/partials/modals/walletTransaction.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | 48 | 61 |
62 | -------------------------------------------------------------------------------- /dapp/src/partials/settings.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | Settings 5 |

6 |
7 |
8 |
9 |
10 |
11 | 12 | 17 | 18 |
19 |
20 | 21 | 24 | 25 |
26 |
27 |
28 |
29 | 30 | 31 |
32 |
33 | 34 | 35 |
36 |
37 |
38 |
39 | 40 | 46 | 47 |
48 |
49 |
50 | 58 |
59 |
60 | 61 |
62 |
63 |

64 | About 65 |

66 |
67 |
68 |
69 |
70 | App Version {{ appVersion }} 71 |
72 |
73 |
74 |
75 | -------------------------------------------------------------------------------- /dapp/css/gnosis-bootstrap-dialog.css: -------------------------------------------------------------------------------- 1 | .bootstrap-dialog { 2 | /* dialog types */ 3 | /** 4 | * Icon animation 5 | * Copied from font-awesome: http://fontawesome.io/ 6 | **/ 7 | /** End of icon animation **/ 8 | } 9 | .bootstrap-dialog .modal-header { 10 | border-top-left-radius: 0px; 11 | border-top-right-radius: 0px; 12 | } 13 | .bootstrap-dialog .bootstrap-dialog-title { 14 | color: #fff; 15 | display: inline-block; 16 | font-size: 16px; 17 | } 18 | .bootstrap-dialog .bootstrap-dialog-message { 19 | font-size: 14px; 20 | } 21 | .bootstrap-dialog .bootstrap-dialog-button-icon { 22 | margin-right: 3px; 23 | } 24 | .bootstrap-dialog .bootstrap-dialog-close-button { 25 | font-size: 20px; 26 | float: right; 27 | opacity: 0.9; 28 | filter: alpha(opacity=90); 29 | } 30 | .bootstrap-dialog .bootstrap-dialog-close-button:hover { 31 | cursor: pointer; 32 | opacity: 1; 33 | filter: alpha(opacity=100); 34 | } 35 | .bootstrap-dialog.type-default .modal-header { 36 | background-color: #ffffff; 37 | } 38 | .bootstrap-dialog.type-default .bootstrap-dialog-title { 39 | color: #333; 40 | } 41 | .bootstrap-dialog.type-info .modal-header { 42 | background-color: #5bc0de; 43 | } 44 | .bootstrap-dialog.type-primary .modal-header { 45 | background-color: #337ab7; 46 | } 47 | .bootstrap-dialog.type-success .modal-header { 48 | background-color: #5cb85c; 49 | } 50 | .bootstrap-dialog.type-warning .modal-header { 51 | background-color: #f0ad4e; 52 | } 53 | .bootstrap-dialog.type-danger .modal-header { 54 | background-color: #d9534f; 55 | } 56 | .bootstrap-dialog.size-large .bootstrap-dialog-title { 57 | font-size: 24px; 58 | } 59 | .bootstrap-dialog.size-large .bootstrap-dialog-close-button { 60 | font-size: 30px; 61 | } 62 | .bootstrap-dialog.size-large .bootstrap-dialog-message { 63 | font-size: 18px; 64 | } 65 | .bootstrap-dialog .icon-spin { 66 | display: inline-block; 67 | -moz-animation: spin 2s infinite linear; 68 | -o-animation: spin 2s infinite linear; 69 | -webkit-animation: spin 2s infinite linear; 70 | animation: spin 2s infinite linear; 71 | } 72 | @-moz-keyframes spin { 73 | 0% { 74 | -moz-transform: rotate(0deg); 75 | } 76 | 100% { 77 | -moz-transform: rotate(359deg); 78 | } 79 | } 80 | @-webkit-keyframes spin { 81 | 0% { 82 | -webkit-transform: rotate(0deg); 83 | } 84 | 100% { 85 | -webkit-transform: rotate(359deg); 86 | } 87 | } 88 | @-o-keyframes spin { 89 | 0% { 90 | -o-transform: rotate(0deg); 91 | } 92 | 100% { 93 | -o-transform: rotate(359deg); 94 | } 95 | } 96 | @-ms-keyframes spin { 97 | 0% { 98 | -ms-transform: rotate(0deg); 99 | } 100 | 100% { 101 | -ms-transform: rotate(359deg); 102 | } 103 | } 104 | @keyframes spin { 105 | 0% { 106 | transform: rotate(0deg); 107 | } 108 | 100% { 109 | transform: rotate(359deg); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /dapp/less/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. ` 17 | 18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 34 |
35 |
36 |

37 | Parameters 38 |

39 |
40 |
41 | 42 | 43 |
44 |
45 |
46 | 47 | 65 | 66 | -------------------------------------------------------------------------------- /dapp/less/mixins/grid-framework.less: -------------------------------------------------------------------------------- 1 | // Framework grid generation 2 | // 3 | // Used only by Bootstrap to generate the correct number of grid classes given 4 | // any value of `@grid-columns`. 5 | 6 | .make-grid-columns() { 7 | // Common styles for all sizes of grid columns, widths 1-12 8 | .col(@index) { // initial 9 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; 10 | .col((@index + 1), @item); 11 | } 12 | .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo 13 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; 14 | .col((@index + 1), ~"@{list}, @{item}"); 15 | } 16 | .col(@index, @list) when (@index > @grid-columns) { // terminal 17 | @{list} { 18 | position: relative; 19 | // Prevent columns from collapsing when empty 20 | min-height: 1px; 21 | // Inner gutter via padding 22 | padding-left: ceil((@grid-gutter-width / 2)); 23 | padding-right: floor((@grid-gutter-width / 2)); 24 | } 25 | } 26 | .col(1); // kickstart it 27 | } 28 | 29 | .float-grid-columns(@class) { 30 | .col(@index) { // initial 31 | @item: ~".col-@{class}-@{index}"; 32 | .col((@index + 1), @item); 33 | } 34 | .col(@index, @list) when (@index =< @grid-columns) { // general 35 | @item: ~".col-@{class}-@{index}"; 36 | .col((@index + 1), ~"@{list}, @{item}"); 37 | } 38 | .col(@index, @list) when (@index > @grid-columns) { // terminal 39 | @{list} { 40 | float: left; 41 | } 42 | } 43 | .col(1); // kickstart it 44 | } 45 | 46 | .calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) { 47 | .col-@{class}-@{index} { 48 | width: percentage((@index / @grid-columns)); 49 | } 50 | } 51 | .calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) { 52 | .col-@{class}-push-@{index} { 53 | left: percentage((@index / @grid-columns)); 54 | } 55 | } 56 | .calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) { 57 | .col-@{class}-push-0 { 58 | left: auto; 59 | } 60 | } 61 | .calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) { 62 | .col-@{class}-pull-@{index} { 63 | right: percentage((@index / @grid-columns)); 64 | } 65 | } 66 | .calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) { 67 | .col-@{class}-pull-0 { 68 | right: auto; 69 | } 70 | } 71 | .calc-grid-column(@index, @class, @type) when (@type = offset) { 72 | .col-@{class}-offset-@{index} { 73 | margin-left: percentage((@index / @grid-columns)); 74 | } 75 | } 76 | 77 | // Basic looping in LESS 78 | .loop-grid-columns(@index, @class, @type) when (@index >= 0) { 79 | .calc-grid-column(@index, @class, @type); 80 | // next iteration 81 | .loop-grid-columns((@index - 1), @class, @type); 82 | } 83 | 84 | // Create grid for specific class 85 | .make-grid(@class) { 86 | .float-grid-columns(@class); 87 | .loop-grid-columns(@grid-columns, @class, width); 88 | .loop-grid-columns(@grid-columns, @class, pull); 89 | .loop-grid-columns(@grid-columns, @class, push); 90 | .loop-grid-columns(@grid-columns, @class, offset); 91 | } 92 | -------------------------------------------------------------------------------- /dapp/config.karma.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Wed Jan 11 2017 14:38:33 GMT+0100 (CET) 3 | 4 | module.exports = function(config) { 5 | const karmaConfig = { 6 | 7 | // base path that will be used to resolve all patterns (eg. files, exclude) 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 13 | frameworks: ['jasmine'], 14 | 15 | 16 | // list of files / patterns to load in the browser 17 | files: [ 18 | 'tests/globalvars.js', 19 | 'node_modules/angular/angular.js', 20 | 'node_modules/angular-mocks/angular-mocks.js', 21 | 'node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js', 22 | 'node_modules/angular-route/angular-route.min.js', 23 | 'node_modules/ngclipboard/dist/ngclipboard.min.js', 24 | 'node_modules/web3/dist/web3.min.js', 25 | 'node_modules/abi-decoder/dist/abi-decoder.js', 26 | 'node_modules/web3-provider-engine/dist/ProviderEngine.js', 27 | 'node_modules/angular-ui-notification/dist/angular-ui-notification.min.js', 28 | // 'node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js', 29 | 'src/app.js', 30 | 'src/abi.js', 31 | 'src/config.js', 32 | 'src/services/**/*.js', 33 | 'tests/*.test*' 34 | ], 35 | 36 | 37 | // list of files to exclude 38 | exclude: [ 39 | //'services/Utils.js', 40 | ], 41 | 42 | // preprocess matching files before serving them to the browser 43 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 44 | preprocessors: { 45 | 46 | }, 47 | 48 | // test results reporter to use 49 | // possible values: 'dots', 'progress' 50 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 51 | reporters: ['progress'], 52 | 53 | 54 | // web server port 55 | port: 9876, 56 | 57 | 58 | // enable / disable colors in the output (reporters and logs) 59 | colors: true, 60 | 61 | 62 | // level of logging 63 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 64 | logLevel: config.LOG_DEBUG, 65 | 66 | 67 | // enable / disable watching file and executing tests whenever any file changes 68 | autoWatch: true, 69 | 70 | 71 | // start these browsers 72 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 73 | browsers: ['Chrome'], //['PhantomJS'], //['Chrome'], 74 | 75 | 76 | // Continuous Integration mode 77 | // if true, Karma captures browsers, runs the tests and exits 78 | singleRun: true, 79 | 80 | // Concurrency level 81 | // how many browser should be started simultaneous 82 | concurrency: Infinity, 83 | 84 | }; 85 | 86 | // 87 | // config.set( 88 | var configuration = { 89 | // other things 90 | customLaunchers: { 91 | Chrome_travis_ci: { 92 | base: 'Chrome', 93 | flags: ['--no-sandbox'] 94 | } 95 | }, 96 | }; 97 | 98 | if (process.env.TRAVIS) { 99 | configuration.browsers = ['Chrome_travis_ci']; 100 | } 101 | 102 | config.set(Object.assign({}, karmaConfig, configuration)); 103 | }; 104 | -------------------------------------------------------------------------------- /dapp/less/tooltip.less: -------------------------------------------------------------------------------- 1 | // 2 | // Tooltips 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .tooltip { 8 | position: absolute; 9 | z-index: @zindex-tooltip; 10 | display: block; 11 | // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. 12 | // So reset our font and text properties to avoid inheriting weird values. 13 | .reset-text(); 14 | font-size: @font-size-small; 15 | 16 | .opacity(0); 17 | 18 | &.in { .opacity(@tooltip-opacity); } 19 | &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; } 20 | &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; } 21 | &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; } 22 | &.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; } 23 | } 24 | 25 | // Wrapper for the tooltip content 26 | .tooltip-inner { 27 | max-width: @tooltip-max-width; 28 | padding: 3px 8px; 29 | color: @tooltip-color; 30 | text-align: center; 31 | background-color: @tooltip-bg; 32 | border-radius: @border-radius-base; 33 | } 34 | 35 | // Arrows 36 | .tooltip-arrow { 37 | position: absolute; 38 | width: 0; 39 | height: 0; 40 | border-color: transparent; 41 | border-style: solid; 42 | } 43 | // Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1 44 | .tooltip { 45 | &.top .tooltip-arrow { 46 | bottom: 0; 47 | left: 50%; 48 | margin-left: -@tooltip-arrow-width; 49 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 50 | border-top-color: @tooltip-arrow-color; 51 | } 52 | &.top-left .tooltip-arrow { 53 | bottom: 0; 54 | right: @tooltip-arrow-width; 55 | margin-bottom: -@tooltip-arrow-width; 56 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 57 | border-top-color: @tooltip-arrow-color; 58 | } 59 | &.top-right .tooltip-arrow { 60 | bottom: 0; 61 | left: @tooltip-arrow-width; 62 | margin-bottom: -@tooltip-arrow-width; 63 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 64 | border-top-color: @tooltip-arrow-color; 65 | } 66 | &.right .tooltip-arrow { 67 | top: 50%; 68 | left: 0; 69 | margin-top: -@tooltip-arrow-width; 70 | border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0; 71 | border-right-color: @tooltip-arrow-color; 72 | } 73 | &.left .tooltip-arrow { 74 | top: 50%; 75 | right: 0; 76 | margin-top: -@tooltip-arrow-width; 77 | border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width; 78 | border-left-color: @tooltip-arrow-color; 79 | } 80 | &.bottom .tooltip-arrow { 81 | top: 0; 82 | left: 50%; 83 | margin-left: -@tooltip-arrow-width; 84 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 85 | border-bottom-color: @tooltip-arrow-color; 86 | } 87 | &.bottom-left .tooltip-arrow { 88 | top: 0; 89 | right: @tooltip-arrow-width; 90 | margin-top: -@tooltip-arrow-width; 91 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 92 | border-bottom-color: @tooltip-arrow-color; 93 | } 94 | &.bottom-right .tooltip-arrow { 95 | top: 0; 96 | left: @tooltip-arrow-width; 97 | margin-top: -@tooltip-arrow-width; 98 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 99 | border-bottom-color: @tooltip-arrow-color; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /test/javascript/testExecutionAfterRequirementsChanged.js: -------------------------------------------------------------------------------- 1 | const MultiSigWallet = artifacts.require('MultiSigWallet') 2 | const web3 = MultiSigWallet.web3 3 | const deployMultisig = (owners, confirmations) => { 4 | return MultiSigWallet.new(owners, confirmations) 5 | } 6 | 7 | const utils = require('./utils') 8 | const ONE_DAY = 24*3600 9 | 10 | contract('MultiSigWallet', (accounts) => { 11 | let multisigInstance 12 | const requiredConfirmations = 2 13 | 14 | beforeEach(async () => { 15 | multisigInstance = await deployMultisig([accounts[0], accounts[1], accounts[2]], requiredConfirmations) 16 | assert.ok(multisigInstance) 17 | }) 18 | 19 | it('test execution after requirements changed', async () => { 20 | const deposit = 1000 21 | 22 | // Send money to wallet contract 23 | await new Promise((resolve, reject) => web3.eth.sendTransaction({to: multisigInstance.address, value: deposit, from: accounts[0]}, e => (e ? reject(e) : resolve()))) 24 | const balance = await utils.balanceOf(web3, multisigInstance.address) 25 | assert.equal(balance.valueOf(), deposit) 26 | 27 | // Add owner wa_4 28 | const addOwnerData = multisigInstance.contract.addOwner.getData(accounts[3]) 29 | const transactionId = utils.getParamFromTxEvent( 30 | await multisigInstance.submitTransaction(multisigInstance.address, 0, addOwnerData, {from: accounts[0]}), 31 | 'transactionId', 32 | null, 33 | 'Submission' 34 | ) 35 | 36 | // There is one pending transaction 37 | const excludePending = false 38 | const includePending = true 39 | const excludeExecuted = false 40 | const includeExecuted = true 41 | assert.deepEqual( 42 | await multisigInstance.getTransactionIds(0, 1, includePending, excludeExecuted), 43 | [transactionId] 44 | ) 45 | 46 | // Update required to 1 47 | const newRequired = 1 48 | const updateRequirementData = multisigInstance.contract.changeRequirement.getData(newRequired) 49 | 50 | // Submit successfully 51 | const transactionId2 = utils.getParamFromTxEvent( 52 | await multisigInstance.submitTransaction(multisigInstance.address, 0, updateRequirementData, {from: accounts[0]}), 53 | 'transactionId', 54 | null, 55 | 'Submission' 56 | ) 57 | 58 | assert.deepEqual( 59 | await multisigInstance.getTransactionIds(0, 2, includePending, excludeExecuted), 60 | [transactionId, transactionId2] 61 | ) 62 | 63 | // Confirm change requirement transaction 64 | await multisigInstance.confirmTransaction(transactionId2, {from: accounts[1]}) 65 | assert.equal((await multisigInstance.required()).toNumber(), newRequired) 66 | assert.deepEqual( 67 | await multisigInstance.getTransactionIds(0, 1, excludePending, includeExecuted), 68 | [transactionId2] 69 | ) 70 | 71 | // Execution fails, because sender is not wallet owner 72 | utils.assertThrowsAsynchronously( 73 | () => multisigInstance.executeTransaction(transactionId, {from: accounts[9]}) 74 | ) 75 | 76 | // Because the # required confirmations changed to 1, the addOwner transaction can be executed now 77 | await multisigInstance.executeTransaction(transactionId, {from: accounts[0]}) 78 | assert.deepEqual( 79 | await multisigInstance.getTransactionIds(0, 2, excludePending, includeExecuted), 80 | [transactionId, transactionId2] 81 | ) 82 | }) 83 | }) --------------------------------------------------------------------------------