Essence Finance
    • Introduction
  • Protocol
    • Peg Stabilty
    • Collateralization
    • Decentralization
  • TOKENOMICS
    • ZEN
    • Distribution
    • Stake
  • Protocol Controlled Value
    • Protocol Controlled Value (PCV)
    • PCV Management
    • PCV Deposits
  • Governance
    • Essence DAO
    • Governance Phases
    • Access Control
    • Roles
  • Smart Contracts
    • Contract Addresses
    • Audits
  • Development
    • Smart Contracts API
      • Chi
        • IChi
      • Minter
        • IPCVEquityMinter
        • PCVEquityMinter
        • RateLimitedMinter
      • Core
        • Core
        • ICore
        • IPermissions
        • IPermissionsRead
        • Permissions
        • ZenRoles
      • Dao
        • Governor
          • EssenceDAO
        • Timelock
          • EssenceDAOTimelock
          • OptimisticTimelock
          • Timelock
      • External
        • Decimal
        • WETH9
      • Libs
        • CoreRefPauseableLib
        • UintArrayOps
      • Oracle
        • ChainlinkOracleWrapper
        • CompositeOracle
        • ConstantOracle
        • ICollateralizationOracle
        • ICollateralizationOracleWrapper
      • Pcv
        • IPCVDeposit
        • IPCVDepositBalances
        • IPCVGuardian
        • IPCVSwapper
        • PCVDeposit
        • PCVGuardian
      • Peg
        • FixedPricePSM
        • IPegStabilityModule
        • IPriceBound
        • IPSMRouter
        • PegStabilityModule
        • PriceBoundPSM
        • PSMRouter
      • Refs
        • CoreRef
        • ICoreRef
        • IOracleRef
        • IUniRef
        • OracleRef
        • UniRef
      • Timelocks
        • ITimelockedDelegator
        • ITokenTimelock
        • LinearTimelockedDelegator
        • LinearTokenTimelock
        • QuadraticTimelockedDelegator
        • QuadraticTimelockedSubdelegator
        • QuadraticTokenTimelock
        • TimelockedDelegator
        • TokenTimelock
      • Utils
        • RateLimited
      • Zen
        • IZenMinter
        • Zen
        • ZenMinter
Powered by GitBook
On this page
  • Functions
  • zero
  • one
  • from
  • ratio
  • add
  • sub
  • sub
  • mul
  • div
  • pow
  • add
  • sub
  • sub
  • mul
  • div
  • equals
  • greaterThan
  • lessThan
  • greaterThanOrEqualTo
  • lessThanOrEqualTo
  • isZero
  • asUint256
  • getPartial
  • compareTo
  1. Development
  2. Smart Contracts API
  3. External

Decimal

Functions

zero

function zero() internal returns (struct Decimal.D256)

one

function one() internal returns (struct Decimal.D256)

from

function from(
    uint256 a
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

a

uint256

ratio

function ratio(
    uint256 a,
    uint256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

a

uint256

b

uint256

add

function add(
    struct Decimal.D256 self,
    uint256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

uint256

sub

function sub(
    struct Decimal.D256 self,
    uint256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

uint256

sub

function sub(
    struct Decimal.D256 self,
    uint256 b,
    string reason
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

uint256

reason

string

mul

function mul(
    struct Decimal.D256 self,
    uint256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

uint256

div

function div(
    struct Decimal.D256 self,
    uint256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

uint256

pow

function pow(
    struct Decimal.D256 self,
    uint256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

uint256

add

function add(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

sub

function sub(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

sub

function sub(
    struct Decimal.D256 self,
    struct Decimal.D256 b,
    string reason
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

reason

string

mul

function mul(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

div

function div(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

equals

function equals(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (bool)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

greaterThan

function greaterThan(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (bool)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

lessThan

function lessThan(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (bool)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

greaterThanOrEqualTo

function greaterThanOrEqualTo(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (bool)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

lessThanOrEqualTo

function lessThanOrEqualTo(
    struct Decimal.D256 self,
    struct Decimal.D256 b
) internal returns (bool)

Parameters

Name
Type
Description

self

struct Decimal.D256

b

struct Decimal.D256

isZero

function isZero(
    struct Decimal.D256 self
) internal returns (bool)

Parameters

Name
Type
Description

self

struct Decimal.D256

asUint256

function asUint256(
    struct Decimal.D256 self
) internal returns (uint256)

Parameters

Name
Type
Description

self

struct Decimal.D256

getPartial

function getPartial(
    uint256 target,
    uint256 numerator,
    uint256 denominator
) private returns (uint256)

Parameters

Name
Type
Description

target

uint256

numerator

uint256

denominator

uint256

compareTo

function compareTo(
    struct Decimal.D256 a,
    struct Decimal.D256 b
) private returns (uint256)

Parameters

Name
Type
Description

a

struct Decimal.D256

b

struct Decimal.D256

PreviousExternalNextWETH9

Last updated 1 year ago