trust-machines / multisafe Goto Github PK
View Code? Open in Web Editor NEWMultiSafe is a shared crypto wallet for managing Stacks (STX) and Bitcoin (BTC).
License: MIT License
MultiSafe is a shared crypto wallet for managing Stacks (STX) and Bitcoin (BTC).
License: MIT License
Optional transaction parameters
param-p
and param-u
are not necessary for every transaction. It's better to have them as optional to keep state data smaller.
A new buffer parameter
An optional buffer parameter param-b
to use for transfer memo.
sip-009 and sip-010 support:
This is something we must have for built-in ft and nft transfers. We need two more executors and transaction parameters as param-ft
(sip-009-trait) and param-nft
(sip-010-trait). They won't be optional since trait references cannot be stored on smart contracts and they have to be validated in confirm
function by taking principal. values with contract-of
function. Therefore we'll need to use some default/none/null values for transactions other than token/nft transfers. I believe that is a reasonable trade-off to provide support for all tokens/nfts.
Include transaction id in get-transaction(s) function response to provide better ux.
Rename min-confirmation
(and all related variables and constants) to threshold
to avoid confusion.
Info function:
A new function to allow read all basic safe information (version, owners, threshold, nonce) at once.
Test improvements:
Our tests getting bigger and they should be improved to provide a cleaner code. Some re-uses can be optimized.
Lines 124 to 130 in e5a3768
There should be one more asserts!
that ensures value
is less than or equal 20.
A user landing straight on https://app.multisafe.xyz/ without knowing about https://linktr.ee/multisafe or this repo should be helped to reach them.
Perhaps add a link to one or both of those pages on the app page too. In the navbar or footer perhaps? Something like: "Docs - Github"
If safe have multiple owners, then one transaction can be executed more than once.
# switch to one of the owners
::set_tx_sender ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5
# create new "transaction"
(contract-call? 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.safe submit 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.set-min-confirmation 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.safe .tx-sender u3)
# change to 2nd owner
::set_tx_sender ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
# confirm transaction => 1st execution
(contract-call? 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.safe confirm u0 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.set-min-confirmation 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.safe)
# change to 3rd owner
::set_tx_sender ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC
# confirm transaction => 2nd execution
(contract-call? 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.safe confirm u0 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.set-min-confirmation 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.safe)
Add here:
Lines 237 to 244 in e5a3768
(asserts! (not (get confirmed tx)) ERR-TX-CONFIRMED)
Does this initiative exist? Might be worth considering adding to this repo (or its own separate repo if that is preferred).
This will enable people to contribute to improving the UI, UX, etc. Speaking for myself, I noted some issues + opportunities and would be interested.
Example issue:
On the Transactions page, when loaded by for review an owner that was not the transaction originator, there is no REVOKE button. So hypothetically speaking, let's say one of the owner accounts was compromised and an unauthorized transaction was made by it. There is no revoke button for the other owners.
I deployed my first safe to mainnet and deposited 5 STX but it doesn't appear in the UI:
We need a variable + getter function to read total transaction count on the safe.
With only 20 bytes for FT/NFT param-b, there is limited information that can be kept
Addresses (at least) 40 characters
Transactions 66 characters
uuid 36 characters
saving it as binary, compressed or both may save a few bytes but doesn't change the fact, that to keep any meaningful information an external storage is required, What where the design goals for the size?
When we change min-confirmations
from X
to Y
it affects both on going and future transactions.
I think that each transaction should have its own fixed min-confirmation
threshold that is set up when transaction is created.
On the Transactions page, when loaded by for review an owner that was not the transaction originator, there is no REVOKE button. So hypothetically speaking, let's say one of the owner accounts was compromised and an unauthorized transaction was made by it. There is no revoke button for the other owners.
It is not a bug per-se, but securing crucial functions with just tx-sender
can be considered as security flaw.
Depending on your security strategy and approach I would suggest securing those functions with contract-caller
or add 1uSTX transfer to crucial functions in order to enforce the need to construct TX with post-conditions.
Reference: https://github.com/LNow/clarity-notes/blob/main/security/function-calls.md
It's better to use SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo contract to make STX transfers instead of using stx-transfer
function since using memo with transfers something mandatory while transferring money to centralized exchanges.
Adding 'get-owners' or 'get-info' function to safe-trait would allow on-chain verification of safe owner from other clarity contracts.
e.g.
In LEOS project, this will help verify if a user have created multi-safe contract, is in the list of owners of that contract or not.
Hello, we just observed there is no License file in this repository -- we're interested in developing on top of MultiSafe and extending it via code contributions here but can't do so if there is no license defined since the opaqueness of not having one creates an undefined state of what is permissible use of this code.
Cc: @muneeb-ali
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.