Skip to content

gorilli-team/fuzemon

Repository files navigation



Fuzemon

1inch Fusion+ integration with Monad Testnet.

Approach

We wanted to add support for Monad Testnet to 1inch Fusion+. To do that, we first recreated the contracts architecture by deploying the AggregationRouterV6, EscrowFactory and Resolver contracts on both Ethereum Sepolia and Monad Testnet. Here are the deployed addresses:

Ethereum Sepolia:

Monad Testnet:

We then created a signed order according to the CrossChainOrder struct provided by the @1inch/cross-chain-sdk. In the example below, we wanted to transfer 100 USDC from Ethereum Sepolia to Monad Testnet, to facilitate the onboarding on the most popular trading apps on the Monad ecosystem, such as Gorillionaire.

const order = Sdk.CrossChainOrder.new(
                new Address(src.escrowFactory),
                {
                    salt: Sdk.randBigInt(1000n),
                    maker: new Address(await srcChainUser.getAddress()),
                    makingAmount: parseUnits('100', 6),
                    takingAmount: parseUnits('99', 6),
                    makerAsset: new Address(config.chain.source.tokens.USDC.address),
                    takerAsset: new Address(config.chain.destination.tokens.USDC.address)
                },
                {
                    hashLock: Sdk.HashLock.forSingleFill(secret),
                    timeLocks: Sdk.TimeLocks.new({
                        srcWithdrawal: 10n,
                        srcPublicWithdrawal: 120n,
                        srcCancellation: 121n,
                        srcPublicCancellation: 122n,
                        dstWithdrawal: 10n,
                        dstPublicWithdrawal: 100n,
                        dstCancellation: 101n
                    }),
                    srcChainId,
                    dstChainId,
                    srcSafetyDeposit: parseEther('0.001'),
                    dstSafetyDeposit: parseEther('0.001')
                },
                {
                    auction: new Sdk.AuctionDetails({
                        initialRateBump: 0,
                        points: [],
                        duration: 120n,
                        startTime: srcTimestamp
                    }),
                    whitelist: [
                        {
                            address: new Address(src.resolver),
                            allowFrom: 0n
                        }
                    ],
                    resolvingStartTime: 0n
                },
                {
                    nonce: Sdk.randBigInt(UINT_40_MAX),
                    allowPartialFills: false,
                    allowMultipleFills: false
                }
            )

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •