A guide to interacting with the IBCO contracts using Remix
Interacting with the IBCO contracts via the Remix IDE is a simple way to get started. It requires minimal background of working with Solidity and the Ethereum blockchain.
Remix allows you to compile Solidity contract code (provided by us), and use those compilation artefacts to connect to the deployed IBCO contract addresses (also provided by us).
You are then able to use the Remix interface to interact with the contract's interfaces: make swaps for sEURO, bond your sEURO, stake your TST etc.
Let's compile the contracts on Remix.
- 2.You should find a list of folders on the left-side of the editor window – right-click the
contractsfolder and select
- 3.Name this file
SEuroOffering.sol, for example, and copy over the contents of our own SEuroOffering contract into the code editor
- 4.Select the Solidity compiler from the left-side menu
- 5.Ensure that the compiler selected is
0.8.15version, to match the
pragmafrom the contract code, and click the
- 6.There will be a compile error, as many of the SEuroOffering contract's local dependencies are yet to be compiled
Once you have compiled all the contracts that we want to test, you are able to connect to the live deployed contracts. This allows you to interact with the contracts directly from Remix.
- 1.Compile the SEuroOffering contract again (for example)
- 2.Go to the Deploy and Run section of the Remix editor
- 3.All of our contracts are currently deployed on Görli Test Network, so you're going to want to connect to that – open Metamask and make sure you're connected to the networkIf you need help getting started with Metamask, or adding the Görli network to Metamask, there's tons of guides out there
- 4.Once our Metamask is connected to Görli, we're going to use that as our remix environment, using the Injected Provider option
- 5.The selected account should be your active connected account in Metamask
- 6.The selected contract should be the last one you compiled, so you can go back to your project structure to compile whichever you'd like to interact with
- 7.To connect to the contract, you need to find the address of our deployed version of that contract, from our index of live contract address. Put that address as the
At Addressvalue and click
At Address. You should find the contract's in the Deployed Contracts section below
- 8.Expand this deployed contract to see all the contracts interfaces that you can interact with. For instance you can see the
statusof the contract by clicking the read-only
- 9.You can also interact with the contract in a bit more of an exciting way by sending transactions to the contract. Let's swap some Görli ETH for sEURO using the SEuroOffering contract!
- 10.The SEuroOffering
swapETHinterface is a payable function. It converts the value of the transaction for sEURO. Let's add some value to the transaction via Remix in the
valuefield aboveI've added 10^17 wei, i.e. 0.1ETH
- 11.Find the
swapETHinterface and run the transaction, after confirming with Metamask, you should see the transaction sent in the logs below
swapETHthen confirm with Metamask when promptedTransaction has been sent, and you can track its progress with Etherscan
- 12.Once everything is completed, and the transaction is mined successfully, you'll get another message in the logs
- 13.You can explore the details of the transaction on EtherscanThe 0.1 Ether value of my transaction was swapped for 192.38 sEURO, which were transferred to my wallet during the transaction
You can use these processes to compile and interact with any of our live deployed contracts.
Bear in mind that some contract interactions will require you to interact with some external contract beforehand. There are some interfaces that require approving ERC20 allowances for our contracts, before sending a transaction.
You can achieve this is much the same way as to what you've done above, by compiling the ERC20 interface, connecting to a token contract, and sending approval transactions.
Good luck out there