Skip to content

Commit 3ac013a

Browse files
committed
chore: set msg.sender as sponsor of async txs
1 parent 52aacf1 commit 3ac013a

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

src/counter/CounterAppGateway.sol

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ contract CounterAppGateway is AppGatewayBase, Ownable {
4444
* @param chainSlug_ The identifier of the target chain
4545
*/
4646
function deployContracts(uint32 chainSlug_) external async {
47+
// This ensures the msg.sender is the one paying for the fees
48+
// for more information see: https://docs.socket.tech/fees
49+
_setOverrides(msg.sender);
4750
_deploy(counter, chainSlug_, IsPlug.YES);
4851
}
4952

@@ -64,6 +67,9 @@ contract CounterAppGateway is AppGatewayBase, Ownable {
6467
* @param instances_ Array of counter contract addresses to increment
6568
*/
6669
function incrementCounters(address[] memory instances_) public async {
70+
// This ensures the msg.sender is the one paying for the fees
71+
// for more information see: https://docs.socket.tech/fees
72+
_setOverrides(msg.sender);
6773
for (uint256 i = 0; i < instances_.length; i++) {
6874
ICounter(instances_[i]).increase();
6975
}
@@ -77,16 +83,4 @@ contract CounterAppGateway is AppGatewayBase, Ownable {
7783
function setMaxFees(uint256 fees_) public {
7884
maxFees = fees_;
7985
}
80-
81-
/**
82-
* @notice Withdraws fee tokens from the SOCKET Protocol
83-
* @dev Allows withdrawal of accumulated fees to a specified receiver
84-
* @param chainSlug_ The chain from which to withdraw fees
85-
* @param token_ The token address to withdraw
86-
* @param amount_ The amount to withdraw
87-
* @param receiver_ The address that will receive the withdrawn fees
88-
*/
89-
function withdrawCredits(uint32 chainSlug_, address token_, uint256 amount_, address receiver_) external {
90-
_withdrawCredits(chainSlug_, token_, amount_, receiver_);
91-
}
9286
}

0 commit comments

Comments
 (0)