đCOTI Remix Plugin
Last updated
Last updated
The COTI Remix plugin seamlessly integrates with the Remix IDE, enabling developers to deploy and interact with contracts on the COTI network.
NOTE: The COTI Remix plugin currently works only with COTI Devnet. Support for COTI Testnet will be published in the coming days.
Head to the Remix website at remix.ethereum.org
IMPORTANT: In order to use the privacy-preserving features of the COTI network with the Remix plugin, your workspace must include both MpcCore.sol
and MpcInterface.sol
files.
The environment section (located at the bottom of the plugin) allows you to select the environment you wish to use to connect to the COTI network. Two options are available:
Wallet: This option uses a browser-based wallet (i.e., MetaMask). You will need to have the COTI network added to your wallet. You may add the COTI network by visiting Chainlist.
Manual (Devnet): This option creates 2 accounts for you in the COTI network.
Both options are tracked in the coti_wallet_config.json
file, stored at the root of your workspace.
The Faucet section will display your account balance and provide a link to the COTI faucet on Discord. To request funds send a message to the bot using the format: devnet <address>
, for example:
The Onboard section of the plugin provides an easy way to generate an AES key. This AES key will be used for encryption and decryption purposes within the COTI network.
If the account has already been onboarded and an AES key has already been created, the key will be displayed in this section.
The Onboard action makes use of the AccountOnboard.sol
smart contract via the Typescript SDK onboard.ts
script.
Once the Onboard
button is clicked, the plugin will return data related to your AES key. You may clear this data by clicking on the Clear AES Key
button.
The AES key is stored in the coti_wallet_config.json
file as "user_key"
.
The "Compile & Deploy" section of the plugin serves a similar purpose to the native Remix "Compile" feature, with the key difference that it allows users to compile contracts that are making use of the privacy-preserving features of the COTI network.
Four sub-sections are offered:
Compile
section
Compiler version drop-down: Allows user to select the desired compiler version
Compile
action button: Compiles the contract using the configured compiler version.
Contract selection drop-down: Allows selection of previously compiled contracts.
Deploy
section
Value (in wei, gwei, or ether): Allows configuration of custom gas amount when the default estimated gas is not used.
Deploy
action button: deploys the indicated contract with the configured parameters.
Load From Address
section
Address
input field: Input field to enter the address of a previously deployed contract.
Load Contract
action button: Loads contract indicated on the Address
field.
The "Interact" section of the plugin serves a similar purpose to the native Remix "Interact" feature, with the key difference that it allows users to interact with contracts that are making use of the privacy-preserving features of the COTI network.
The COTI Remix plugin will automatically encrypt/decrypt values of type IT
(input text) and CT
(cipher text).
For IT
(input text) value types, only cleartext is required, the encryption is performed automatically by the plugin.
Click the "Plugin manager" button, located on the lower-left part of the screen in Remix
The plugins are organized alphabetically. Keep scrolling until you see the COTI plugin and click "Activate".
On the file manager permission dialog, tick the "Remember this choice" box so the plugin doesn't ask every time it runs. Click "Accept".
The COTI plugin button will appear on the left hand panel, below the Git button . Click on the plugin button.