Skip to content

Commit

Permalink
pay relayer: don't force claim to have bridge amount
Browse files Browse the repository at this point in the history
  • Loading branch information
nalinbhardwaj committed Nov 2, 2024
1 parent 0634795 commit b09f3d4
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 228 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions packages/contract/script/deployV2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SCRIPTS=(
# "script/pay/DeployDaimoPayBridger.s.sol"
# "script/pay/DeployPayIntentFactory.s.sol"
# "script/pay/DeployDaimoPay.s.sol"
# "script/pay/DeployDaimoPayRelayer.s.sol" # The deployer must be the LP that calls this contract.
"script/pay/DeployDaimoPayRelayer.s.sol" # The deployer must be the LP that calls this contract.

# DAv2
# "script/DeployFlexSwapper.s.sol"
Expand All @@ -33,20 +33,20 @@ SCRIPTS=(
)
CHAINS=(
# MAINNETS
# "$ETHERSCAN_API_KEY_BASE,https://base-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
# "$ETHERSCAN_API_KEY_OP,https://opt-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
# "$ETHERSCAN_API_KEY_ARB,https://arb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
# "$ETHERSCAN_API_KEY_POLYGON,https://polygon-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
# "$ETHERSCAN_API_KEY_LINEA,https://linea-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
# "$ETHERSCAN_API_KEY_L1,https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY" # Expensive, deploy last
"$ETHERSCAN_API_KEY_BASE,https://base-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
"$ETHERSCAN_API_KEY_OP,https://opt-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
"$ETHERSCAN_API_KEY_ARB,https://arb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
"$ETHERSCAN_API_KEY_POLYGON,https://polygon-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
"$ETHERSCAN_API_KEY_LINEA,https://linea-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY"
"$ETHERSCAN_API_KEY_L1,https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY" # Expensive, deploy last

# Not supporting Avalanche, skip.
# No Alchemy for Avalanche, Etherscan key is "verifyContract"
# "verifyContract,https://avalanche-c-chain-rpc.publicnode.com"

# TESTNETS
# "$ETHERSCAN_API_KEY_L1,https://eth-sepolia.g.alchemy.com/v2/$ALCHEMY_API_KEY"
# "$ETHERSCAN_API_KEY_BASE,https://sepolia.base.org"
"$ETHERSCAN_API_KEY_L1,https://eth-sepolia.g.alchemy.com/v2/$ALCHEMY_API_KEY"
"$ETHERSCAN_API_KEY_BASE,https://sepolia.base.org"

)

Expand Down
2 changes: 1 addition & 1 deletion packages/contract/script/pay/DeployDaimoPayRelayer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract DeployDaimoPayRelayer is Script {
vm.startBroadcast();

address daimoPayRelayer = CREATE3.deploy(
keccak256("DaimoPayRelayer-test5"),
keccak256("DaimoPayRelayer-test11"),
abi.encodePacked(
type(DaimoPayRelayer).creationCode,
abi.encode(owner)
Expand Down
8 changes: 7 additions & 1 deletion packages/contract/src/pay/DaimoPayRelayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,16 @@ contract DaimoPayRelayer is Ownable2Step {
}

dp.claimIntent({intent: intent, calls: calls});

// Transfer any bridgeTokenOut balance back to the owner
uint256 balance = TokenUtils.getBalanceOf(
intent.bridgeTokenOut.token,
address(this)
);
TokenUtils.transfer({
token: intent.bridgeTokenOut.token,
recipient: payable(msg.sender),
amount: intent.bridgeTokenOut.amount
amount: balance
});
}

Expand Down
4 changes: 2 additions & 2 deletions packages/daimo-contract/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export {
daimoPayAcrossBridgerAbi,
daimoPayBridgerAbi,
daimoPayCctpBridgerAbi,
daimoPayRelayerAbi,
daimoPaymasterV2Abi,
daimoPaymasterV2Address,
daimoPayRelayerAbi,
daimoRequestAbi,
daimoRequestAddress,
daimoRequestConfig,
Expand Down Expand Up @@ -71,7 +71,7 @@ export const payIntentFactoryAddress =
"0xa4ce06F41FfC631f004e4c451D70C6E5A0f7f175";
/** Daimo Pay relayer address */
export const daimoPayRelayerAddress =
"0xea5426c21c893fcaD30742ce6e95f8db15A23616";
"0x547F08b3Cd77b94cfd2C90127B829bbDa9b2f9d9";

// DAv2
export const entryPointV07Address =
Expand Down

0 comments on commit b09f3d4

Please sign in to comment.