Challenge: Split Ratios

Test yourself by creating a contract that includes split ratios.

Problem statement

For this challenge, create a contract with the following features:

  • An array of numbers called splitRatios.

  • It should check if the length of the splitRatios array is greater than 2.

  • It should also check if all the numbers inside the array are greater than 5.

  • If not, then it should fail with error messages when it’s deployed.

Input

There is no input for this challenge.

Output

The code will display the error message.

Try it yourself

Write the code for the contract in the contracts/contract.sol file and the run script in the scripts/run.js file. Click the “Run” button in the code widget below to test your solution:

Get hands-on with 1200+ tech skills courses.