Vectis - Smart Contract Wallet

Related tags

Cryptography vectis
Overview

Vectis - Smart Contract Wallet

Cosmowasm 0.20.0

Overview

Smart Contract Wallet allows user to interact with DAPPs on the blockchain with the same amount of autonomy of a classic non-custodial solution, but with more flexibility by providing functionalities designed to serve the user. SCW also provide functions that allow businesses to satisfy regulatory requirements regarding support of users, transparency, separation of control duties and verifiability.

Design

SCW is designed to provide the user with confidence whilst interacting with the DApps by providing the most amount of control yet allowing recoverability. It also enables companies to drive mass adoption of blockchain-based services by their customers, providing a better user experience, solving the problems of buying gas in advance, increasing the resilience, security and verifiability of their solutions.

At the core, the SCW builds on cw-1 specifications for proxy contracts, with the addition of roles and functionalities listed below.

We also provide a factory contract to instantiate the SCW, this allows service providers to help users instantiate SCW and keep track of the wallets they potentially are guardians / relayers of.

Roles

There are 3 roles in a SCW:

  1. user: the address that this wallet services, they have full control over the roles assignment and wallet operations
  2. guardians: the addresses appointed by the user to protect the user (via key recovery and / or account freezing)
  3. relayers the addresses appointed by the user to allow for user's off-chain transaction signatures be committed on-chain with gas.

Hack

Contracts Code Test

cd contracts
cargo test

Local Node

1. Set up wasmd locally, which has the Cosmwasm module and a CLI

git clone https://github.com/CosmWasm/wasmd.git
cd wasmd
# replace the v0.18.0 with the most stable version on https://github.com/CosmWasm/wasmd/releases
git checkout v0.20.0
make install

# verify the installation
wasmd version

INFO: make install will copy wasmd to $HOME/go/bin or the default directory for binaries from Go, please make sure that is in your PATH.

2. Start the node

./local-node-setup.sh

3. Compile smart contracts

# compile the contracts with suitable RUSTFLAGS for compact wasm code size
RUSTFLAGS='-C link-arg=-s' cargo wasm-factory
RUSTFLAGS='-C link-arg=-s' cargo wasm-proxy

Interact with the Local Node

We are using cosmJS to test the smart contracts with the local node. The testing framework used is Jasmine The JS app is in the js-app directory.

Please ensure you have set up the .env.dev file according to the example.env. More details of the roles are in ./local-node-setup.sh.

Note: The tests include deploying the contracts

cd js-app
npm i           # Install all dependencies
npm test        # Run tests

Gitpod integration

The /contracts directory is generated from the cosmwasm template which provides config for gitpod.

Gitpod container-based development platform will be enabled on your project by default.

Workspace contains:

  • rust: for builds
  • wasmd: for local node setup and client
  • jq: shell JSON manipulation tool

Follow Gitpod Getting Started and launch your workspace.

Comments
  • FYI: upgrade to cosmwasm-typescript-gen makes binary export unneeded

    FYI: upgrade to cosmwasm-typescript-gen makes binary export unneeded

    see this PR for context: https://github.com/public-awesome/stargaze-contracts/pull/304/files

    previously you had to manually export Binary, now it's taken care of by the transpiler.

    npm install -g [email protected]
    
    opened by pyramation 19
  • compile wasm for external contracts in setup script

    compile wasm for external contracts in setup script

    In ./local_*_setup.sh we are using wasm files stored in e2e/wasm repo.

    This is not ideal and hard to maintain for versioning. We should build the wasm from versioned code.

    opened by whalelephant 4
  • Use the cosmwasm repo dependency

    Use the cosmwasm repo dependency

    @pyramation 's repo has now been moved to under the cosmwasm org and we should update our dependencies.

    https://github.com/CosmWasm/cosmwasm-typescript-gen

    opened by whalelephant 3
  • Frozen accounts should allow guardians to do key rotation

    Frozen accounts should allow guardians to do key rotation

    Writing up discussions with @giovanni-orciuolo

    In the case where a wallet has been frozen (by guardians at the request of the user) and the user wants the guardian to rotate the user key, the guardian should be able to rotate the key without unfreezing the wallet first. This is important as unfreezing it may allow a malicious actor with the old user key to update the list of guardians.

    opened by whalelephant 2
  • Multisig re-instantiation

    Multisig re-instantiation

    Explanation notes

    1. migrate_multisig_contract handle is added to the factory contract. (Note: you have to trigger it per each wallet address manually)
    2. proxy migrate function is updated to handle both multisig and proxy migrations, depending on the type of migration message provided.
    3. migration related security checks refactoring performed.
    4. RelayTxError & MigrationMsgError error types refactored into factory package crate.
    5. Multisig related migration integration tests added. Closes https://github.com/nymlab/vectis/issues/5, https://github.com/nymlab/vectis/issues/4
    opened by iorveth 2
  • Test/dao admin

    Test/dao admin

    • Make use of ExecuteAdminMsgs in the cw-core contract for tests, this role is removed after funds.dao.specs.ts tests are ran.
    • Added to revert changes in the tests for configs so that following tests will not fail on the same chain without redeploy
    • ts test: fixed staking, wasm relay and getting the newly created proxy wallet correctly (all cli tests now pass)
    • clippy and fmt rust code
    • removed unused imports in cli/ and have clearer logs in deploy script
    • update_chain_config interface to allow for String addr instead of Canonical in the fields
    opened by whalelephant 1
  • feat: vectis events

    feat: vectis events

    DAO-TUNNEL

    • instantiate -> vectis.dao_tunnel.v1.MsgInstantiate
      • contract_address
    • add_approved_controller -> vectis.dao_tunnel.v1.MsgAddApprovedController
      • connection_id
      • port_id
    • remove_approved_controller -> vectis.dao_tunnel.v1.MsgRemoveApprovedController
      • connection_id
      • port_id
    • update_dao -> vectis.dao_tunnel.v1.MsgUpdateDaoAddr
      • address
    • update_govec -> vectis.dao_tunnel.v1.MsgUpdateGovecAddr
      • address
    • update_ibc_transfer_channel -> vectis.dao_tunnel.v1.MsgUpdateIbcTransferRecieverChannel
      • connection_id
      • channel_id
    • dispatch_to_remote_tunnel -> vectis.dao_tunnel.v1.MsgDispatchActionOnRemoteTunnel
      • channel_id
      • job_id
    • ibc_transfer -> vectis.dao_tunnel.v1.MsgIbcTransfer
      • to
      • channel_id
      • amount // should be casted to number //
      • denom

    FACTORY/REMOTE_FACTORY

    • instantiate -> vectis.factory.v1.MsgInstantiate
      • contract_address
    • create_wallet -> vectis.factory.v1.MsgCreateWallet
      • wallet_id
    • migrate_wallet -> vectis.factory.v1.MsgMigrateWallet
    • update_code_id -> vectis.factory.v1.MsgUpdateCodeId"
      • type ?
      • code_id // should be casted to number //
    • update_config_fee -> vectis.factory.v1.MsgUpdateConfigFee
      • type ?
      • amount // should be casted to number //
      • denom
    • claim_govec -> vectis.factory.v1.MsgClaimGovec
      • proxy_address
    • govec_minted -> vectis.factory.v1.MsgGovecMinted
      • proxy_address
      • minted -> success | failed

    PROXY

    • instantiate -> vectis.proxy.v1.MsgInstantiate
      • controller_address
      • multisig_code_id // should be casted to number //
      • code_id // should be casted to number //
      • label
      • relayers ?
      • guardians ?
    • execute -> vectis.proxy.v1.MsgExecute
    • relay -> vectis.proxy.v1.MsgRelay
    • add_relayer -> vectis.proxy.v1.MsgAddRelayer
      • address
    • remove_relaer -> vectis.proxy.v1.MsgRemoveRelayer
      • address
    • freeze_status -> vectis.proxy.v1.MsgRevertFreezeStatus
      • status -> frozen | unfrozen
    • rotate_controller_key -> vectis.proxy.v1.MsgRotateControlKey
      • old_address
      • new_address
    • update_guardians -> vectis.proxy.v1.MsgUpdateGuardians
      • guaridans
      • multisg // should be casted to boolean //
      • multisig_code_id -> optional
    • request_update_guardian -> vectis.proxy.v1.MsgRequestUpdateGuardians
      • create // should be casted to boolean //
      • guardians -> optional
    • update label -> vectis.proxy.v1.MsgUpdateLabel
      • label
    • reply -> MsgReplyMultisigInstantiate
      • contract_address
      • multisig_address
      • multisig_code_id // should be casted to number //

    REMOTE TUNNEl

    • dispatch -> vectis.remote-tunnel.v1.MsgDispatch
      • job_id
    • ibc-transfer -> vectis.ibc-transfer.v1.MsgIbcTransfer
      • channel_id
      • to
      • amount
      • denom
    opened by j0nl1 1
  • Remove indexed storage

    Remove indexed storage

    As our user interface fetch from indexer: https://github.com/nymlab/vectis-subquery

    We should remove states following the merge of https://github.com/nymlab/vectis_fe/issues/55. In particular, remove the mapping of user_addr => vec

    opened by whalelephant 1
  • Align Query::Balances interface with cw20 interface and transfer balance when updating DAO

    Align Query::Balances interface with cw20 interface and transfer balance when updating DAO

    • added new query to see if addr has joined
    • Query::Balance returns zero if addr has not joined
    • transfer all exisiting DAO token to new DAO on execute_update_dao
    opened by whalelephant 1
  • User (Controller of wallet) should be able to vote on daodao.zone UI with all their govec tokens

    User (Controller of wallet) should be able to vote on daodao.zone UI with all their govec tokens

    Currently, proxy wallet direct interaction with DApp UIs are not feasible because we have yet to include an extension / wallet.

    An intermedia solution is to allow the user to stake their wallets' govec token so they can propose + vote.

    opened by whalelephant 1
  • Testnet deploy updates

    Testnet deploy updates

    • update testnet daodao contracts ids
    • update wasm artefacts to new daodao contracts
    • update type in createPropInstMsg for updated daodao contracts
    • update createFactoryInstMsg to allow passing in of Govec addr
    • added test to ensure govec is set in factory
    opened by whalelephant 1
  • Gas Profiling Report in Pipeline

    Gas Profiling Report in Pipeline

    I think will be great to have a gas usage report in our pipeline, there is a github action which use cosm-orc to get this report. cosm-orc allows us to run contract tests against a real local chan and measure gas usage

    https://github.com/de-husk/cosm-orc-gas-diff-action

    opened by j0nl1 0
  • support validation of addresses from other chains

    support validation of addresses from other chains

    Currently in Gove, dao-contracts, we trust that the dao-tunnel forwards the correct address as string. ideally, we should validate those addresses with the correct prefix.

    opened by whalelephant 0
  • dao-tunnel ack needs to be binary

    dao-tunnel ack needs to be binary

    acknowledgement written dst_channel=channel-3 dst_port=wasm.juno1vnfn0e4vnn58ydpm05wqcc9zp8t5ztwd5rw5f895lykqaezmuccqfxvekr module=x/ibc/channel sequence="marshaling error: json: unsupported type: func() uint64" src_channel=channel-3 src_port=wasm.wasm1cr9cyjmw2dmwmy76lzrruepldhxvlg09pxkn5c53wl2en993uk2s9yycg2

    opened by whalelephant 0
Owner
Nymlab
Empowering Decentralised Networks Through SSI
Nymlab
A Bitcoin wallet collider that brute forces random wallet addresses written in Rust.

Plutus-Rustus Bitcoin Brute Forcer A Bitcoin wallet collider that brute forces random wallet addresses written in Rust. This is a straight port of Plu

null 46 Dec 23, 2022
Substrate NFT !ink smart contract base

Substrate !ink NFT simple implementation This is a simple working version of base NFT smart contract written using latest (as of this date) !ink 3.0.0

POLK4.NET 14 Dec 3, 2022
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

Zeke Medley 7 Oct 3, 2022
Testing a smart contract on the Solana blockchain

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

Maurice 1 Oct 25, 2021
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

zeke 7 Oct 3, 2022
The NFT smart contract powering xyz on Terra

xyz NFT Contract This repository contains the core NFT smart contract that implements xyz, a base layer for metaverses on the Terra blockchain. The xy

null 16 Sep 25, 2022
An example smart contract that builds on top of xyz

xyz Guestbook Tutorial Contract This repository contains an example smart contract that illustrates how to build on top of the xyz NFT contract. This

null 5 Apr 4, 2022
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️

Solana BPF Boilerplate Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana This boilerplate provides the following. Si

ono 6 Jan 30, 2022
Smart Contract for Terra Name Service

TERRA NAME SERVICE CONTRACTS Terra Name Service is to create easy-to-remember names for your Terra address like ‘dokwon.ust’ instead of ‘terra1...whez

null 12 Nov 23, 2022
Emerging smart contract language for the Ethereum blockchain.

Emerging smart contract language for the Ethereum blockchain.

null 1.4k Jan 9, 2023
Smart Contract built in Rust to run inside Cosmos SDK module on all chains that enable it

CoinSwap is a Smart Contract that is built on the terra blockchain and can be used to swap cryptocurrencies such as LUNA, UST, TerraUSD, Anchor, Mirror Protocol, LUNI and other CW20 tokens. The Project also contains a smart contract which works as a analysis tool for the gas fees on the Terra Blockchain.

Prajjwal Chittori 9 Oct 11, 2022
Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.

Heimdall is an advanced EVM toolkit which aims to make dealing with smart contracts on EVM based chains easier. Installation & Usage Heimdall's update

Jonathan Becker 489 Jan 2, 2023
A simple example demonstrating cross-contract calls in CosmWasm smart contracts

Cross-contract calls This tutorial demonstrates cross-contract calls with CosmWasm v1. Overview An end user calls the reservation contract to register

csli Tools 3 Sep 12, 2022
The Ink! smart contract SDK for XVM interface

Ink! XVM SDK The Ink! smart contract SDK for XVM interface. This SDK contains contract wrappers and all middleware code to make XVM development easy.

Astar Network 13 Jan 3, 2023
Example NFT marketplace project using ink! smart contract.

NFT Marketplace project This contract is an example for the NFT marketplace implementation. License Apache 2.0 ??️ How to use - Contracts ?? Build Use

Swanky dApps 8 Jan 18, 2023
An EVM low-level language that gives full control over the control flow of the smart contract.

Meplang - An EVM low-level language Meplang is a low-level programming language that produces EVM bytecode. It is designed for developers who need ful

MEP 19 Jan 31, 2023
A smart-contract api and client for revm

revmup A smart contract and client API for revm. Features: Auto-generate contracts that interact directly with revm without needing ethers provider Co

Dave Bryson 17 Aug 6, 2023
A brand-new multi-scenarios smart contract compiler framework

The Smart Intermediate Representation The Smart Intermediate Representation(short for IR) project is a new compiler framework intended for smart contr

AntChainOpenLabs 62 Jan 2, 2024
My attempt at learning Solana program (smart contract) development through RareSkill's Solana course.

60-days-of-solana My attempt at learning Solana program (smart contract) development through RareSkill's Solana course. Originally, I was trying to cr

Jasper 3 Feb 25, 2024