Alkemi Earn Contracts
Earn App
Earn API
Search…
Alkemi Earn Contracts
docs
EIP20NonStandardInterface (EIP20NonStandardInterface.sol)
EIP20Interface.sol
RewardControlStorage.sol
TestTokens.sol
Careful Math (CarefulMath.sol)
RewardControlInterface.sol
AggregatorV3Interface.sol
PriceOracleProxy.sol
RewardControl.sol
Migrations.sol
SafeToken.sol
AlkemiWETH.sol
Exponential module for storing fixed-precision decimals (ExponentialNoError.sol)
AlkemiEarnPublic.sol
ErrorReporter.sol
AlkemiEarnVerified.sol
Earn Interest Rate Model (AlkemiRateModel.sol)
PriceOracle.sol
ExchangeRateModel.sol
Exponential.sol
LiquidationChecker.sol
InterestRateModel Interface (InterestRateModel.sol)
SafeMath.sol
ChainLink.sol
PriceOracleInterface.sol
Liquidator.sol
.solidoc
scripts
Powered By
GitBook
Careful Math (CarefulMath.sol)
View Source:
contracts/CarefulMath.sol
​
↗ Extends:
ErrorReporter
↘ Derived Contracts:
Exponential
​
Derived from OpenZeppelin's SafeMath library
https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
​
Functions
mul(uint256 a, uint256 b)
div(uint256 a, uint256 b)
sub(uint256 a, uint256 b)
add(uint256 a, uint256 b)
addThenSub(uint256 a, uint256 b, uint256 c)
mul
Multiplies two numbers, returns an error on overflow.
1
function
mul
(
uint256 a
,
uint256 b
)
internal pure
2
returns
(
enum
ErrorReporter
.
Error
,
uint256
)
Copied!
Arguments
Name
Type
Description
a
uint256
​
b
uint256
​
div
Integer division of two numbers, truncating the quotient.
1
function
div
(
uint256 a
,
uint256 b
)
internal pure
2
returns
(
enum
ErrorReporter
.
Error
,
uint256
)
Copied!
Arguments
Name
Type
Description
a
uint256
​
b
uint256
​
sub
Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).
1
function
sub
(
uint256 a
,
uint256 b
)
internal pure
2
returns
(
enum
ErrorReporter
.
Error
,
uint256
)
Copied!
Arguments
Name
Type
Description
a
uint256
​
b
uint256
​
add
Adds two numbers, returns an error on overflow.
1
function
add
(
uint256 a
,
uint256 b
)
internal pure
2
returns
(
enum
ErrorReporter
.
Error
,
uint256
)
Copied!
Arguments
Name
Type
Description
a
uint256
​
b
uint256
​
addThenSub
add a and b and then subtract c
1
function
addThenSub
(
uint256 a
,
uint256 b
,
uint256 c
)
internal pure
2
returns
(
enum
ErrorReporter
.
Error
,
uint256
)
Copied!
Arguments
Name
Type
Description
a
uint256
​
b
uint256
​
c
uint256
​
Previous
TestTokens.sol
Next
RewardControlInterface.sol
Last modified
9mo ago
Copy link
Contents
Functions