ACU Contract Interface

Autonomous Currency Unit (ACU) Contract functions

Interfaces for interacting with the ASM Autonomous Currency Unit Contract functions using:

Protocol contract calls

Examples for calling functions from aut use the setup described in the How to Submit a transaction with Autonity CLI.

Usage and Examples illustrate using the ACU Contract’s generated ABI and the aut tool’s contract command to call the ACU Contract address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA. See aut contract call --help.

Usage and Examples assume the path to the ABI file has been set in aut’s configuration file .autrc. The ACU.abi file is generated when building the client from source and can be found in your autonity installation directory at ./params/generated/ACU.abi. Alternatively, you can generate the ABI using the abigen cmd utility if you built from source (See Install Autonity, Build from source code).

getRound

Returns the Oracle round of the current ACU index value.

Parameters

None.

Response

Field Datatype Description
round uint256 the oracle voting round number for the latest successfully computed ACU index value

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA getRound

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA getRound
33400

getScale

Returns the decimal places used to represent the ACU as a fixed-point integer.

Note this is also the scale used to represent the basket quantities. See modifyBasket().

Parameters

None.

Response

Field Datatype Description
scale uint256 the decimal places used to represent the ACU as a fixed-point integer

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA getScale

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA getScale
7

getScaleFactor

Returns the multiplier for scaling numbers to the ACU scaled representation.

Parameters

None.

Response

Field Datatype Description
scaleFactor uint256 the scale factor for ACU index values

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA getScaleFactor

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA getScaleFactor
10000000

multiplier

Returns the quantity multiplier that is used to compute the ACU index value.

Parameters

None.

Response

Field Datatype Description
quantityMultiplier uint256 the ACU quantity multiplier

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA multiplier

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA multiplier
10000000

quantities

Returns the basket quantities used to compute the ACU index value.

Parameters

None.

Response

Field Datatype Description
_quantities uint256 array an array of the quantities

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA quantities

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA quantities
[1744583, 1598986, 1058522, 886091, 175605573, 12318802, 1148285]

scaledQuantities

Returns the scaled quantities used to compute the ACU index value.

Parameters

None.

Response

Field Datatype Description
scaled uint256 array an array of the scaled quantities

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA scaledQuantities

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA scaledQuantities
[1744583, 1598986, 1058522, 886091, 175605573, 12318802, 1148285]

symbols

Returns the currency pair symbols used to compute the ACU index.

Parameters

None.

Response

Field Datatype Description
_symbols string array a comma-separated list of the currency pair symbols used to compute the ACU index value

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA symbols

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA symbols
["AUD-USD", "CAD-USD", "EUR-USD", "GBP-USD", "JPY-USD", "SEK-USD", "USD-USD"]

value

Returns the latest value for the ACU index that was computed.

Parameters

None.

Response

Field Datatype Description
_value int256 the ACU value in fixed-point integer representation rescaled by the quantity multiplier

If there is no value the function reverts with the error NoACUValue.

Usage

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA value

Example

aut contract call --address 0x8Be503bcdEd90ED42Eff31f56199399B2b0154CA value
8307395