Skip to main content

AmountCalculator

A helper contract for calculations related to order amounts

Functions#

getMakingAmount#

function getMakingAmount(  uint256 orderMakerAmount,  uint256 orderTakerAmount,  uint256 swapTakerAmount) public returns (uint256)

Calculates maker amount

Parameters:#

NameTypeDescription
orderMakerAmountuint256
orderTakerAmountuint256
swapTakerAmountuint256

Return Values:#

NameTypeDescription
Resultuint256Floored maker amount

getTakingAmount#

function getTakingAmount(  uint256 orderMakerAmount,  uint256 orderTakerAmount,  uint256 swapMakerAmount) public returns (uint256)

Calculates taker amount

Parameters:#

NameTypeDescription
orderMakerAmountuint256
orderTakerAmountuint256
swapMakerAmountuint256

Return Values:#

NameTypeDescription
Resultuint256Ceiled taker amount

arbitraryStaticCall#

function arbitraryStaticCall(  address target,  bytes data) external returns (uint256)

Performs an arbitrary call to target with data

Parameters:#

NameTypeDescription
targetaddress
databytes

Return Values:#

NameTypeDescription
Resultuint256Bytes transmuted to uint256