--via-ir
flag. The relevant methods for other tools may vary.NewInitiaERC20.sol
IConnectOracle
interface from the @initia/initia-evm-contracts
package.
connect
: The interface of the ConnectOracle contractcurrencyPair
: The variable that stores the currency pair response from ConnectOracleprice
The variable that stores the single pair price response from ConnectOracleprices
The variable that stores the multiple pair prices response from ConnectOracleoracle_get_all_currency_pairs
: This function will return all of the asset pairs currently supported by Connectoracle_get_price
: This function will return the price of a single asset pairoracle_get_prices
: This function will return the price of multiple asset pairsforge compile
, we will get an error.
This is because the default Oracle.t.sol
expects the original Oracle.sol
contract to be available. To fix this, we will rename Oracle.t.sol
to OracleTest.t.sol
.
forge compile
should work without any errors.
forge create
command
oracle_get_all_currency_pairs
function using Foundry’s cast send
command.
currencyPairs
variable using Foundry’s cast call
command, you should see the response from Connect.