Meson in Solidity
We have implemented the Meson protocol with Solidity smart contracts, and deployed to the following EVM-compatible public chains:
- Ethereum
- BNB Chain (formerly BSC)
- Polygon
- Evmos Mainnet
- Arbitrum
- Optimism
- Aurora (on NEAR)
- Conflux eSpace
- Avalanche C-chain
- Fantom
- Tron
- Harmony
- Moonriver
- Moonbeam
The chain-specific invariants are given in the
MesonConfig.sol
file. The compile and deploy script will automatically set this config file.SHORT_COIN_TYPE
(uint16): The identifier of the chain. We use the last 2 bytes of SLIP-44 as the unique ID of a chain:ChainShort Coin TypeEthereum0x003cTron0x00c3Conflux0x01f7Optimism0x0266BNB Chain0x02caPolygon0x03c6Fantom0x03efHarmony0x03ffMoonbeam0x0504Moonriver0x0505Aurora0x0a0aEvmos0x11bcAvalanche0x2328Arbitrum0x2329MIN_BOND_TIME_PERIOD
(uint256) &MAX_BOND_TIME_PERIOD
(uint256): The minimal and maximum expire time when bonding a swap, set to 1 hour and 2 hours, respectively. The swap encoding will include a timestampexpireTs
before which the user's assets will be locked on the initial chain. The LP should callexecuteSwap
beforeexpireTs
to take away the swapping fund. TheexpireTs
needs to satisfyts_bonded_tx + MIN_BOND_TIME_PERIOD < expireTs < ts_bonded_tx + MAX_BOND_TIME_PERIOD
, wherets_bonded_tx
is the block time for the executedpostSwap
transaction.LOCK_TIME_PERIOD
(uint256): The time length when an LP locks a swap, sets to 40 minutes. The initiator should sign the release signature to get swapped assets on the target chain before the timets_locked_tx + LOCK_TIME_PERIOD
, wherets_locked_tx
is the block time for the executedlock
transaction.REQUEST_TYPE_HASH
(bytes32): Equals tokeccak256(bytes32 "Sign to request a swap on Meson")
orkeccak256(bytes32 "Sign to request a swap on Meson (Testnet)")
. It's used when checking the request signature.RELEASE_TYPE_HASH
(bytes32): Equals tokeccak256(bytes32 "Sign to release a swap on Meson" + bytes32 [Recipient])
orkeccak256(bytes32 "Sign to release a swap on Meson (Testnet)" + bytes32 "[Recipient]")
. It's used when checking the release signature.
https://github.com/MesonFi/meson-contracts-solidity
github.com
Meson Smart Contracts
Last modified 9mo ago