Mantle

Mantle supports Solidity contract deployment through Ethereum-compatible tools

Updated on

Mantle lets you deploy Solidity contracts with familiar Ethereum tooling when the compiled bytecode matches its supported EVM execution environment. Choose a test environment for rehearsal, compile the contract, and send a creation transaction through a funded signer. Native MNT pays network gas. A successful transaction receipt establishes execution success; the contract address and its runtime code establish where the instance exists. The deployment environment determines whether that instance belongs to a sandbox, testnet, or mainnet.

In short: Keep the compiler settings and constructor arguments with the deployment record so you can reproduce and verify the contract.

Local testing, Mantle Sepolia, or mainnet

Local tests suit isolated contract logic; a public testnet suits a rehearsal involving shared onchain state and wallet signing. Mantle Sepolia is a public testnet for Mantle. A local EVM sandbox keeps contract tests apart from public-network transactions. Remote node access also introduces provider limits a local test may not reproduce. Mainnet introduces real balances and production dependencies, so its deployment configuration needs its own review. Testnet success does not establish the correctness of mainnet dependency addresses or administrative settings.

Mantle Sepolia uses chain ID 5003. Mainnet uses chain ID 5000. Keep the network identifier with every deployment address.

Compiler settings and deployment tools

Compiler compatibility requires both a Solidity compiler version compatible with the source and an EVM target the destination supports. The source pragma constrains the compiler version, while the EVM target controls which instructions the compiler may emit, so pin both settings before compiling and testing the artifact you intend to deploy. A successful local build alone cannot establish compatibility with the remote chain. Compiler defaults can change between releases, so retaining an explicit target prevents an upgrade from silently changing the bytecode assumptions.

Graphic: Mantle: Compiler settings and deployment tools
Compiler settings and deployment tools

Open full-size image

Remix puts compilation and deployment controls in a browser interface. Hardhat and Foundry support project-based development and scripted deployment. Project files can keep deployment parameters beside tests and build artifacts, which helps when constructor inputs or dependencies change across releases. Interactive controls suit individual deployment requests, while scripts capture a workflow you need to reproduce. These approaches all require a compatible build and a signer configured for the destination.

In Remix, configure the Solidity Compiler panel, compile the intended contract, and select it in Deploy & Run. Choose Browser Extension to connect a supported browser wallet.

The wallet must select the intended network and hold enough native MNT there for gas. Supply any required constructor arguments before requesting deployment. A deployment script instead binds its network endpoint and signing account through configuration. Public node access does not supply an unlocked deployment account: signing belongs to the wallet or another configured signer. The node receives the signed transaction through eth_sendRawTransaction. Keep signing secrets outside contract source, browser client code, and committed configuration files.

What confirms a contract deployment on the selected network?

A successful creation receipt confirms execution, and a code query at its contract address confirms runtime code exists on the selected network at the queried block. A transaction hash identifies the submitted transaction. It does not establish its execution outcome. For a direct creation transaction, inspect the receipt's status and contractAddress, then query eth_getCode at that address using the intended chain's endpoint. Record the chain alongside the address because an address alone cannot identify its network.

Diagram: Mantle - What confirms a contract deployment on the selected network?

Open full-size image

The eth_getTransactionReceipt method returns no receipt for a pending transaction. A missing receipt therefore needs further diagnosis, including whether the endpoint knows the transaction. An execution failure has a different meaning from an unprocessed transaction. Neither state satisfies a successful deployment check. Receipt inclusion also differs from settlement finality, so an application needing finalized state must apply its confirmation policy separately.


The same contract in a sandbox and a public testnet

This hypothetical rehearsal starts with compatible Solidity bytecode and no contract instance on the intended public testnet. An external application needs that instance on the public network.

Assume the contract requires no constructor arguments or attached native currency. A local sandbox deployment can execute the same program and produce an address. That address identifies an instance in the sandbox, which does not meet the application's public-network requirement. The Solidity program stays the same in both environments; only the network receiving the creation request changes.

Select the wallet-connected deployment environment, with the wallet on the intended public testnet and sufficient native gas funds. Check the selected chain before approving the creation request. The signed request then targets the public network, with the same compatible bytecode used for the local rehearsal. The signing account pays the network fee, with the transaction's attached value set to zero.

Illustration: Mantle: The same contract in a sandbox and a public testnet

Open full-size image

In this rehearsal, the creation receipt reports success, and the public-testnet endpoint returns runtime code at the resulting address. The application now has a public-network address for its contract calls.


Published source and deployment artifacts

Source-code verification requires the source and compilation settings matching the deployed build. Keep the complete source files, dependency versions, compiler version, optimizer settings, EVM target, linked-library addresses when applicable, and constructor arguments with the deployment record. Recompiling with changed settings can produce different bytecode even when the Solidity logic looks unchanged. Retain metadata and compiler input as well as the application binary interface, or ABI, which describes callable functions and their argument types.

Source-code verification compares published source with the bytecode used for a deployed contract. It gives others readable code to inspect. It does not establish that the contract's permissions, economic assumptions, or external calls are safe.

A verification failure does not undo a successful deployment. Diagnose the verification failure before submitting another creation transaction. Redeploying to fix a verification mismatch can create another instance and leave application configuration pointing at an earlier address.


Read calls, permissions, and production data

Application integration needs the correct chain, contract address, and ABI to encode calls and decode responses. An offchain eth_call can execute a read without publishing a state change. A transaction can persist changes when execution succeeds. A view function invoked within a transaction still contributes execution work to that transaction. Keep read results separate from confirmed writes when the application displays contract state.

Gas fees apply to contract creation and later transactions. A read request avoids an onchain transaction fee, although its RPC provider can impose access limits or service charges.

Permissions need their own tests before a production deployment. Check the callers each protected function accepts and the state changes it permits. For code making external calls, a called contract can reenter the calling contract before the original operation finishes, so the ordering of authorization checks, internal updates, and external interactions affects reentrancy exposure. Test failure paths alongside successful calls, particularly functions transferring native currency or invoking other contracts.

Solidity's private visibility specifier restricts access through contract code but does not conceal blockchain data. Keep secrets out of constructor arguments and storage. Production callers will rely on the published address and permissions, so incorrect initialization can require a new deployment or an upgrade the contract already supports.

Key questions about Mantle

Does Solidity's ether unit mean a Mantle contract receives ETH?

Solidity's ether suffix scales a numeric value; it does not select the asset a contract receives. Mantle uses native MNT for native-value transfers and gas. An inherited label mentioning ETH can therefore misdescribe a payment on this network. Keep native-currency amounts distinct from token-contract balances when adapting an Ethereum application.

Will redeploying an Ethereum contract on Mantle copy its existing storage?

Redeploying contract code does not automatically copy its Ethereum storage or balances to Mantle. A new instance starts with its own initialization on the destination chain. Moving an existing application's data or assets requires a migration mechanism appropriate to that application. Reusing its Solidity source alone does not carry over user positions or establish equivalent dependency addresses.

When can a Mantle application upgrade its logic without changing its public address?

An application using an upgradeable proxy can keep the proxy's address while changing its implementation through its authorized upgrade mechanism. The design must already support that operation. Ordinary deployment does not create an upgrade facility automatically. Proxy upgrades also need compatible storage layout and protected upgrade permissions to preserve the application's state and intended control.

Which account receives administrative rights when a factory deploys a Mantle contract?

Administrative rights follow the contract's initialization and access-control logic. If its constructor assigns an owner from msg.sender, deployment through a factory makes that immediate caller the factory. A constructor accepting an explicit administrator can assign a different account. Paying the outer transaction's gas does not override either rule, so deployment configuration must match the intended owner assignment.