Details of the Contract

Learn to define and incorporate the terms of the contract in Solidity.

Terms of the contract

Let’s think about what we would like to do with this contract:

  • We want to create a contract that requires two or more wallet addresses that can accept payments.

  • The contract will also require split ratios to be defined for each given address. A 1:1 split ratio means an equal split. A 2:1 split means that the first address will get double the amount of the second one.

  • The contract will store these given addresses and split ratios.

  • The contract should be able to receive and store payments.

  • When a withdrawal is requested, the stored amount should be transferred to the contract’s parties in the designated split ratio.

Press + to interact

The code for the smart contract is available on the blockchain for anyone to see. This transparency is great because we can verify that the contract works as intended by reading the code. However, it also means that anyone could dissect the contract to exploit its vulnerabilities. ...