@ -1,7 +1,7 @@
import {
AgentConnectionType ,
ChainMap ,
chainMetadata ,
getDomainId ,
hyperlaneEnvironments ,
} from '@hyperlane-xyz/sdk' ;
import { objMap } from '@hyperlane-xyz/utils' ;
@ -12,10 +12,7 @@ import {
allAgentChainNames ,
routerMatchingList ,
} from '../../../src/config' ;
import {
GasPaymentEnforcementConfig ,
MatchingList ,
} from '../../../src/config/agent/relayer' ;
import { GasPaymentEnforcementConfig } from '../../../src/config/agent/relayer' ;
import { ALL_KEY_ROLES , Role } from '../../../src/roles' ;
import { Contexts } from '../../contexts' ;
@ -52,84 +49,53 @@ const contextBase = {
} ,
} as const ;
const gasPaymentEnforcement : GasPaymentEnforcementConfig [ ] = [
{
type : GasPaymentEnforcementPolicyType . None ,
// To continue relaying interchain query callbacks, we whitelist
// all messages between interchain query routers.
// This whitelist will become more strict with
// https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/1605
matchingList : interchainQueriesMatchingList ,
} ,
{
type : GasPaymentEnforcementPolicyType . OnChainFeeQuoting ,
} ,
] ;
const nautilusWarpRoutes : Array < ChainMap < { router : string } > > = [
const bscNautilusWarpRoutes : Array < { router : string } > = [
{
bsc : {
router : '0xC27980812E2E66491FD457D488509b7E04144b98' ,
} ,
nautilus : {
router : '0x4501bBE6e731A4bC5c60C03A77435b2f6d5e9Fe7' ,
} ,
solana : {
router :
'0xc5ba229fa2822fe65ac2bd0a93d8371d75292c3415dd381923c1088a3308528b' ,
} ,
router : '0xC27980812E2E66491FD457D488509b7E04144b98' ,
} ,
// ETH
{
bsc : {
router : '0x2a6822dc5639b3fe70de6b65b9ff872e554162fa' ,
} ,
nautilus : {
router : '0x182E8d7c5F1B06201b102123FC7dF0EaeB445a7B' ,
} ,
router : '0x2a6822dc5639b3fe70de6b65b9ff872e554162fa' ,
} ,
// USDC
{
bsc : {
router : '0x6937a62f93a56D2AE9392Fa1649b830ca37F3ea4' ,
} ,
nautilus : {
router : '0xB2723928400AE5778f6A3C69D7Ca9e90FC430180' ,
} ,
router : '0x6937a62f93a56D2AE9392Fa1649b830ca37F3ea4' ,
} ,
// BTC
{
bsc : {
router : '0xB3545006A532E8C23ebC4e33d5ab2232Cafc35Ad' ,
} ,
nautilus : {
router : '0x61DDB465eEA5bc3708Cf8B53156aC91a77A2f029' ,
} ,
router : '0xB3545006A532E8C23ebC4e33d5ab2232Cafc35Ad' ,
} ,
// USDT
{
bsc : {
router : '0xb7d36720a16A1F9Cfc1f7910Ac49f03965401a36' ,
} ,
nautilus : {
router : '0xBDa330Ea8F3005C421C8088e638fBB64fA71b9e0' ,
} ,
router : '0xb7d36720a16A1F9Cfc1f7910Ac49f03965401a36' ,
} ,
// POSE
{
bsc : {
router : '0x807D2C6c3d64873Cc729dfC65fB717C3E05e682f' ,
} ,
nautilus : {
router : '0xA1ac41d8A663fd317cc3BD94C7de92dC4BA4a882' ,
} ,
router : '0x807D2C6c3d64873Cc729dfC65fB717C3E05e682f' ,
} ,
] ;
const nautilusWarpRouteMatchingList = nautilusWarpRoutes . reduce (
( agg , warpRoute ) = > [ . . . agg , . . . routerMatchingList ( warpRoute ) ] ,
[ ] as MatchingList ,
) ;
const gasPaymentEnforcement : GasPaymentEnforcementConfig [ ] = [
{
type : GasPaymentEnforcementPolicyType . None ,
// To continue relaying interchain query callbacks, we whitelist
// all messages between interchain query routers.
// This whitelist will become more strict with
// https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/1605
matchingList : [
. . . interchainQueriesMatchingList ,
{
originDomain : [ getDomainId ( chainMetadata . bsc ) ] ,
senderAddress : bscNautilusWarpRoutes.map ( ( r ) = > r . router ) ,
destinationDomain : '*' ,
recipientAddress : '*' ,
} ,
] ,
} ,
{
type : GasPaymentEnforcementPolicyType . OnChainFeeQuoting ,
} ,
] ;
const hyperlane : RootAgentConfig = {
. . . contextBase ,
@ -148,17 +114,7 @@ const hyperlane: RootAgentConfig = {
recipientAddress : '0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE' ,
} ,
] ,
gasPaymentEnforcement : [
// Don't require gas payments for ZBC bridging.
// In practice, gas payments are forced to still occur due to on-chain fee quoting.
// We need this because the IGP that's paid on BSC isn't the "canonical" one (it's from a PI deployment),
// and because the Solana warp route does not yet have an IGP configured.
{
type : GasPaymentEnforcementPolicyType . None ,
matchingList : nautilusWarpRouteMatchingList ,
} ,
. . . gasPaymentEnforcement ,
] ,
gasPaymentEnforcement ,
} ,
validators : {
docker : {