Sparqet Profile picture
Jun 4 11 tweets 5 min read Twitter logo Read on Twitter
Today, I'm going to walk you through the functions of the MultiSig Wallet smart contract on #Starknet. Brace yourself for an exciting dive into the world of #Cairo1 and #SmartContracts.

1/11
The constructor function is the first function called when the contract is deployed. It takes an array of owners & a required number of confirmations as input. It adds each owner to the contract, & sets up the number of confirmations needed to approve a transaction.

2/11 Image
The submitTransaction function allows only wallet owners to propose transactions. It accepts an address, a value. A new transaction with these details, marked as not yet executed, will be added to the transactions list.

3/11 Image
The confirmTransaction function lets wallet owners confirm proposed transactions. It checks if the transaction exists, isn't executed yet, and hasn't been confirmed by the caller. It increments the transaction's confirmation count.

4/11 Image
The executeTransaction function allows owners to execute confirmed transactions. It checks if the transaction exists, hasn't been executed, and has required confirmations. On execution, it sets the transaction status to executed.

5/11 Image
The revokeConfirmation function lets owners withdraw their confirmation of a transaction. It verifies if the transaction exists, hasn't been executed, and was confirmed by the caller. It reduces the confirmation count and revokes the caller's confirmation

6/11 Image
The getOwners function provides a way to access the list of wallet owners. It's a view function, meaning it doesn't alter any data on the blockchain, it just reads and returns the owners array.

7/11 Image
The getTransactionCount function returns the total number of transactions that have been submitted to the wallet. As a view function, it simply reads the length of the transactions array and returns it, providing a count of transactions.

8/11 Image
The getTransaction function retrieves the details of a specific transaction by its index. It returns the recipient's address, the value, whether it has been executed, and the number of confirmations it has received. Essential for tracking transaction status!

9/11 Image
And, of course, the events that will be emitted in the various functions described above.

10/11 Image
That's it for today's rundown of the MultiSigWallet contract! Over the next few days, we'll take a deeper dive into each function, examining how they interact & contribute to the contract's overall functionality.

11/11

#Starknet #Cairo1 #CairoLang

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Sparqet

Sparqet Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(