Welcome to the Arbitrum stylus remix plugin repository.
This tool is the best solution for deploying smart contracts written in languages like Rust through Arbitrum Stylus in Remix IDE. As long as you write your smart contract in a language that can be compiled to WASM here, you will be able to compile, deploy, activate, and even directly execute the contract through Stylus.
Table of Contents
-
Installation: You don't need to install anything. If you want to use our plugin, simply go to the plugin manager in Remix IDE and search for "Arbitrum Stylus." If you prefer to use it without searching, you can click this direct link for a faster and easier experience.
-
Usage: Once you access the plugin, your wallet will automatically connect. After that, users can either write their own contracts or load examples of pre-written contracts through the templates provided. For more detailed information, please refer to the usage section below.
- Activate the plugin in Remix IDE. You can either access it via this direct link or go to the plugin manager in Remix IDE and search for "Arbitrum Stylus" to activate it.
- Upon accessing, the wallet address and balance can be automatically retrieved through MetaMask connected to the Arbitrum network. If MetaMask is not connected to the Arbitrum network, it will automatically switch to the mainnet. If the mainnet information is not available, it will be automatically added.
- Create a new project under the arbitrum/ directory, or use the "Create Template" option to automatically generate a Rust-based project.
- Create Template: Create a simple example contract code written in Rust. You can create a sample contract by selecting the template option and clicking the
Create
button. More templates may be found at Stylus Samples. - New Project: Automatically generate a contract structure. Click the
Create
button to create a contract structure. - Create Manually: You can create your own contract projects without using the features above. However, for the remix plugin to build and deploy the contract, it must be built within the directory
arbitrum/
. If you start a new project, the structure should look like the following.
arbitrum
└── <YOUR_PROJECT_NAME>
├── Cargo.toml
└── src
└── contract.rs
└── examples
└── schema.rs
- Write your smart contract in a language supported by Arbitrum Stylus
- Once the smart contract code is complete, select the contract you wish to deploy from the target template and click the Compile button. After compilation, the bytecode for deployment will be generated as a deployment_tx_data.txt file in the output folder of the respective directory.
- Select the project you want to compile in the TARGET PROJECT section.
- Select a compilation option and click the
Compile
button. - When the compilation is complete, a tx_data and abi files are returned.
- Once the contract is successfully compiled, a Deploy button will appear below the Compile button. Click the Deploy button to deploy your contract.
- After a successful deployment, the contract address will be displayed below the button, allowing you to check the deployed contract on an explorer.
- If activation is required, click the Activate button to send an activation transaction, which is necessary to use the contract. If the contract is already activated, an interaction tab will be available for you to start interacting with the contract.
- You can interact with the deployed smart contract through the Contracts section in the Remix IDE plugin.
- Once deployment or activation is complete, an interaction tab will be generated in the Contracts section, where you can see all the contracts you have deployed.
- Alternatively, you can manually register the contract by entering the address and ABI directly.
- You can select the desired contract to interact with. The most recently deployed contract address will be shown below the deploy button, so you can find the corresponding contract tab to interact with it.
- The list of functions in the contract will be displayed, and you can provide input values and invoke the functions as needed.