Code Monkey home page Code Monkey logo

ovm-og-multisigwallet's Introduction

Optimistic Ethereum Multisignature Wallet

The original Gnosis multisig wallet, updated to work on Optimistic Ethereum. The repository for the EVM-only version of this project can be found here.

The purpose of multisig wallets is to increase security by requiring multiple parties to agree on transactions before execution. Transactions can be executed only when confirmed by a predefined number of owners. A web user interface can be found here.

Use

The frontend is available for use with Optimistic Ethereum at https://ogg.scopelift.co. It can be used with Optimistic Mainnet or Optimistic Kovan testnet.

The MultiSigWalletFactory contract is deployed at the following addresses:

Network Factory Address
Optimistic Mainnet 0xA5e6EFdA500FD0BCEd87B2cd8Af1c81c0cc9D556
Optimistic Kovan 0x676Fcee7AF0dD0060b238d00d43A5542f3aA3B3e

Install

NOTE: We recommend installing volta for managing versions of node, npm, and yarn.

The contracts development environment has been tested with node v10.23.3. The frontend in app/ is tested with node v14.16.0 and yarn v1.22.10. Both projects will automatically use the appropriate versions if your system has volta installed.

git clone https://github.com/ScopeLift/ovm-og-multisigwallet.git
cd ovm-og-multisigwallet

# Install contract dev dependencies
npm install

# Run contract tests for the EVM
npm test

# Run contract tests for the OVM
npm run test:ovm

# Install frontend dev dependencies
cd app
yarn

# Run frontend in dev mode
yarn dev

# Build static frontend in out/
yarn export

Deploy Contracts

The deployment script will deploy MultiSigWalletFactory, then instantiate the first MultiSigWallet with the deployer as the single owner

Create .env file

cp .env.example .env
# Edit your .env file and populate with valid values

Deploy to local development EVM

npm run deploy

Deploy to other EVM network in truffle-config.js

npm run deploy -- --network=kovan

Deploy to local development OVM

npm run deploy:ovm

To run a local OVM network, see the Optimism integration repo

Deploy to other OVM network

npm run deploy:ovm -- --network=kovan

Note the valid networks are local, kovan, and mainnet, and are NOT defined by the contents of truffle-config-ovm.js. See deploy/deploy-ovm.js for more information.

Limitations

This implementation does not allow the creation of smart contracts via multisignature transactions. Transactions to address 0 cannot be done. Any other transaction can be done.

Security

All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

License

LGPL v3

ovm-og-multisigwallet's People

Contributors

adrion avatar apbendi avatar carchrae avatar davidalbela avatar denisgranha avatar dsalko avatar ethers avatar georgi87 avatar germartinez avatar giacomolicari avatar gitter-badger avatar ldct avatar leviadam avatar mischat avatar radchukd avatar rmeruane avatar someguy123 avatar wabieth avatar wildmolasses avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ovm-og-multisigwallet's Issues

Change Owner Form Modifications

The "Change Owner" form should be modified for clarity such that:

  • Instead of saying "Replaced Owner Address", it should say "Replace Owner:", then a line break, then the address
  • The address of the owner being replaced should not be an editable form entry. Instead it should be determined by which button the user clicks on to open the form, and should not be modifiable after that.
  • The "New Owner Address" and text field should go below the "Replace Owner" entry described above

Screen Shot 2021-09-29 at 4 57 14 PM

Fix Wallet Screen Loading State

When refreshing or directly visiting a wallet, the app momentarily shows the screen that says "Sorry, you tried to open a wallet with an invalid address" message. This seems to happen because the app is establishing its connection to the browser wallet (metamask, etc..).

wallet-refresh

Instead of showing this screen, we should show some kind of loading indication instead, such as a standard spinner or something similar. The app should still show this screen when warranted, that is, when the user is really trying to visit an invalid wallet.

Barebones Frontend Rewrite

Rough requirements

  • Must at least take an address of existing multisig instance
    • (possibly defer on "create new wallet" functionality)
  • must read existing multisig state and display it. This includes owners, pending transactions, etc. (can refer to current dapp for this)
  • allow user to interact with the wallet - add an owner, create & propose transaction, confirm existing transaction
  • Minimal styling
  • integrate hardware wallet support!

See this doc for more details

Allow User to Expand Transaction Data Field

When viewing a wallet, the user should be able to view the full, non-truncated data associated with a tx they are considering signing.

To enable this, we'll make the "Data" field clickable. When the user hovers over the cell, it should give some indication of click-ability, such as an icon appearing or the content becoming underlined. When the user clicks it, a modal should open that shows the full contents.

Screen Shot 2021-09-22 at 10 14 31 AM

Fix Pagination Before First TX

For a given multisig instance, before the first transaction is submitted, it shows "Page 1 of 0":

Screen Shot 2021-07-15 at 10 56 06 PM

It also allows advancing the past page 1:

Screen Shot 2021-07-15 at 10 56 12 PM

It should say "Page 1 of 1" and it should not be possible to click next.

Add Owner Validations

The add owner modal should be modified to provide some basic verification to the user input

  • If the ethers isAddress method returns false, the user should see "Please enter an invalid address" error message
  • If the address entered is already an owner, the user should see "This address is already an owner" error message. (Be sure to compare normalized addresses here to ensure there are no capitalization differences.

The user should not be able to click "Submit" unless these checks pass

Screen Shot 2021-09-24 at 4 09 49 PM

Wallet Screen Improvements

  • Show Jazzicon of the address to the right of the Destination address in the Transactions section
  • Show the Jazzicon of the address to the right of the "Owner Signatures" in the Transactions section
  • Show the Jazzicon of the address to the right of the "Owner Address" in the Owners section
  • Show the truncated address (i.e. 0x1234...5678) in the "Owner Signatures" field in the Tranasactions section (NOT in the Owners section)
  • Only show the "Sign" (or "Revoke") button if the connected wallet address is one of the Owners
  • Add some padding between the address and "Sign" or "Revoke" button

Screen Shot 2021-09-29 at 5 19 04 PM

  • Only show the "Change requirement" button if the connected wallet address is one of the Owners
  • The copy of the "Change requirement" button should instead read "Change Threshold"
  • Only show the "Add new transaction" button if the connected wallet address is one of the Owners
  • The copy of the "Add new transaction button should instead read "Add Transaction"
  • Only show the "Add new owner" button if the connected wallet address is one of the Owners
  • The copy of the "Add new owner" button should instead read "Add Owner"
  • Only show the "Actions" column of the Owners table if the connected wallet address is one of the Owners

Change Signature Requirement Validations

The "Change Signature Requirement" modal allows the user to enter— and attempt to submit— values that are out of bounds.

Screen Shot 2021-09-23 at 7 37 48 AM

The number of signatures required is at minimum 1, and at maximum, the number of "owners" on the wallet. So if a wallet has 3 owners, the only valid inputs should be 1, 2, or 3.

  • If the user enters a number below 1, they should see a message saying: "Signature requirement must be at least 1"
  • If the user enters a number above the number of owner, they should see a message saying: "Cannot require more signatures than owners"
  • In either of the invalid scenarios described above, the "Submit" button should be inactive ("greyed out") and unclickable
  • Additionally, if the user selects the number of signatures that is already set, the "Submit" button should be inactive and unclickable, but no error message is needed (example: the wallet currently requires 2 signatures to execute, and the form currently says 2)

Create Multisig Validations

The "Create Multisig" form on the homepage does not do any validations, and does not show error messages well.

  • Update the error/validation messages to show inside a red box with red text, the same style as on the wallet modals:

Screen Shot 2021-09-24 at 4 21 38 PM

  • If the number of signatures is greater than the number of proposed owners, show the message "Cannot require more signatures than owners"
  • If the number of signatures being requested is less than 1, show the message "Signature requirement must be at least 1"

Screen Shot 2021-09-24 at 4 19 47 PM

  • If the ethers isAddress method returns false, the user should see "Please enter an invalid address" error message
  • If any of the addresses in the list are duplicated, show the message "Owner addresses must be unique" error message. (Be sure to compare normalized addresses here to ensure there are no capitalization differences.

Screen Shot 2021-09-24 at 4 20 51 PM

  • The user should not be able to click "Deploy Multisig" until at least one owner has been proposed, the number of signatures has been populated, and all validation errors are cleared.

Make Addresses Clickable In Wallet and Link to Etherscan

  • Addresses displayed in the wallet should be clickable (see image below)
  • Hovering over the address should give some indication of they can be clicked, such as a small icon appearing or the text becoming underlined
  • Clicking the link should take the user to the appropriate Etherscan URL, based on whether the user is connected to Optimistic Ethereum (chain ID 10) vs. Optimistic Kovan (chain ID 69)

Screen Shot 2021-09-22 at 10 14 31 AM

Transactions Table Enhancements

  • Users should be able to sort the transaction table
    • The table should be sortable on the contents of the following columngs: ID, Destination, Status
    • Clicking the header of a sortable column should 1) Make it the sorted column if not already selected 2) Toggle sorting of the column from ascending to descending or vice versa if already selected
    • There should be some indicator in the header showing which column is the sorted column, and which direction, such as a small arrow pointing up or down
  • Users should be able to show more than 5 records per page by selecting the number to show from a menu to the left of the page indicator. It should only show if the wallet being displayed has more than 5 transactions. The options should be as follows: 5, 7, 10, 25, 50, All

Screen Shot 2021-09-29 at 5 34 47 PM

Screen Shot 2021-09-29 at 5 34 41 PM

Add Some Padding To Bottom Of App

When the page exceeds the height of the browser, and the user scrolls to the bottom, the owners table runs into the bottom of the browser window. Add a little bit of padding to the bottom.

Hide Change Threshold Button On Single Owner Wallets

It isn't possible to change the threshold on a multisig wallet if it has only 1 owner. We should not show the "Change Threshold" button (previously "Change requirement" before #46) if the wallet has only one owner, even if that owner is the connected wallet.

Header Updates

  • Remove Chain ID indicator
  • Remove Block Number indicator
  • Remove Red/Green connection indicator next to the address
  • Put a grey rounded rectangle around the wallet/indicator
  • Add Jazzicon to right of address
  • Change copy when connected to Kovan to read "Optimistic Kovan", not "Optimistic Ethereum Testnet Kovan"
  • Clicking on the network indicator should bring up the same "Connect Wallet" Modal as clicking on the wallet address does

Screen Shot 2021-09-23 at 12 40 11 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.