Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.

Simple on-chain database

RocketPool

• version 1.0.0Storage

Database

Ledger

Audited

Audited

1.0.0

RocketPool

🍞 0x77CA downloaded

9/26/2022

Any contract you deploy is yours.

Fully owned and controlled by your wallet.

Fully owned and controlled by your wallet.

Documentation

Source Code

tryAdd(uint256,uint256) :

This function is an internal pure function that attempts to add two uint256 values, a and b. It first calculates the sum of a and b, and then checks if the sum is less than a. If it is, it returns false and 0, otherwise it returns true and the sum. (autogenerated documentation)

trySub(uint256,uint256) :

This function is an internal pure function that takes two uint256 parameters, a and b. It checks if b is greater than a, and if it is, it returns false and 0. Otherwise, it returns true and the difference between a and b. (autogenerated documentation)

tryMul(uint256,uint256) :

This function is an internal pure function that takes two uint256 values (a and b) and attempts to multiply them together. It first checks if a is equal to 0, and if so, it returns true and 0. If a is not equal to 0, it multiplies a and b together and stores the result in c. It then checks if c divided by a is equal to b, and if so, it returns true and c. If not, it returns false and 0. (autogenerated documentation)

tryDiv(uint256,uint256) :

This function is an internal pure function that takes two uint256 parameters, a and b. It attempts to divide a by b and returns a boolean and uint256 value. If b is equal to 0, the function returns false and 0. Otherwise, it returns true and the result of the division. (autogenerated documentation)

tryMod(uint256,uint256) :

This function is an internal pure function that takes two uint256 parameters, a and b. It checks if b is equal to 0, and if it is, it returns false and 0. Otherwise, it returns true and the remainder of a divided by b. (autogenerated documentation)

add(uint256,uint256) :

This function adds two uint256 values together and returns the result. It uses a require statement to ensure that the result of the addition does not exceed the maximum value of a uint256. If the addition does exceed the maximum value, an error is thrown. (autogenerated documentation)

sub(uint256,uint256) :

This function is an internal function that subtracts two uint256 values and returns the result. It requires that the second value (b) is less than or equal to the first value (a). If this condition is not met, an error is thrown. Otherwise, the function returns the difference between the two values (a - b). (autogenerated documentation)

mul(uint256,uint256) :

This function is an internal function that multiplies two uint256 numbers and returns the result. It first checks if the first number is 0, and if so, it returns 0. Otherwise, it multiplies the two numbers and checks if the result is valid by dividing the result by the first number and comparing it to the second number. If the result is valid, it returns the result, otherwise it throws an error. (autogenerated documentation)

div(uint256,uint256) :

This function is an internal function that performs a division operation on two unsigned 256-bit integers (uint256). It requires that the divisor (b) is greater than 0, and returns the result of the division (a/b). (autogenerated documentation)

mod(uint256,uint256) :

This function is an internal pure function that calculates the modulo of two uint256 numbers. It requires that the second number (b) is greater than 0, and returns the remainder of the division of the first number (a) by the second number (b). (autogenerated documentation)

sub(uint256,uint256,string) :

This function is an internal pure function that subtracts two uint256 values and returns the result. It also requires a string argument for an error message, which is used in the require statement to check if the second argument (b) is less than or equal to the first argument (a). If it is not, then the require statement will throw an error with the provided error message. If the condition is met, then the function will return the result of subtracting b from a. (autogenerated documentation)

div(uint256,uint256,string) :

This function is an internal pure function that divides two unsigned integers (uint256) and returns the result. It requires that the second argument (b) is greater than 0, and if it is not, it will throw an error with the provided error message. The result of the division is returned as an unsigned integer. (autogenerated documentation)

mod(uint256,uint256,string) :

This function is an internal pure function that calculates the modulo of two unsigned integers (uint256). It takes in two uint256 values (a and b) and a string (errorMessage) as parameters. It requires that b is greater than 0, and if it is not, it will throw an error with the errorMessage string. If b is greater than 0, the function will return the modulo of a and b. (autogenerated documentation)

Share

Download Source

npx cookbookdev i simple-on-chain-database

🍞 0x77CA downloaded

9/26/2022

1.0.0

Cookbook is free.

Any contract you deploy is yours.

Your contract is owned and controlled by you.

Any contract you deploy is yours.

Your contract is owned and controlled by you.