Smart Contracts Continued
Understand how to improve smart contract tests by validating multiple addresses and split ratios. Learn to update contracts with require statements for input checks and modify deployment scripts accordingly. This lesson guides you through writing test cases that confirm the contract deploys correctly and fails with invalid inputs, helping you build robust Solidity contracts.
We'll cover the following...
Improve the test script
After writing a contract that takes two addresses, we would like our eventual contract to work with two or more addresses and an equivalent amount of split ratios. The script should have the following conditions:
The contract deploys without errors when provided with the required amount of addresses and split ratios.
The contract fails when the amount of addresses and split ...