Contract Deployment
Arbitrum supports standard EVM contract deployment. This allows standard Solidity smart contracts to be deployed on Arbitrum Chains using existing developer tools.
To deploy your contracts, you need to set your deployment tool to deploy on an Arbitrum rollup chain instead of Ethereum. While this should be straightforward, we include instructions for some build systems here, and we will add to the list over time. If you're using a build system that's not listed here and having trouble configuring it, please reach out to us on Discord.
Truffle
To port an existing truffle configuration:
First add the
arb-ethers-web3-bridge
to your project:yarn add --dev arb-ethers-web3-bridge
Edit the
truffle-config.js
:- Import
wrapProvider
fromarb-ethers-web3-bridge
and set the mnemonic and the url to an Arbitrum aggregator at the top of the file:
const wrapProvider = require('arb-ethers-web3-bridge').wrapProvider const HDWalletProvider = require('@truffle/hdwallet-provider') const mnemonic = 'jar deny prosper gasp flush glass core corn alarm treat leg smart' const arbProviderUrl = 'http://localhost:8547/'
- Import
- Add the `arbitrum` network to `module.exports`:
```js
module.exports = {
arbitrum: {
provider: function () {
// return wrapped provider:
return wrapProvider(
new HDWalletProvider(mnemonic, arbProviderUrl)
)
},
network_id: '*',
gasPrice: 0,
},
},
}
```
Now that the truffle project is set up correctly, just run migrate to deploy your contracts
truffle migrate --reset --network arbitrum