Solidity: Transaction that requires multiple people to approve before being sent?

66 Views Asked by At

How can I go about creating a function that can do this?

Example: Person 1 created the transaction and sets an amount. Person 2 approves the transaction and the amount gets sent to the contract till approved by Person 1.
Person 1 approves and the amount gets sent to Person 1 (or another address) from the contract (or Person 2).

I tried multiple escrow tutorials but couldn't get them to work the way I want.

1

There are 1 best solutions below

0
On

What you are trying to create is called a multisignature wallet.

The most well-known multisignature wallet for Ethereum and EVM-compatible blockchains is Gnosis Safe.

You can study Gnosis Safe source code to understand how to build your own multisignature wallet.

For simpler examples, you can look up old Parity multisignature wallet which had one of its versions hacked many years ago.