Skip to content

Commit

Permalink
chore(docs): revise docs on charging fees to caller (#462)
Browse files Browse the repository at this point in the history
Revise docs on charging xcall fees to the caller, rather than the
contract.

task: none
  • Loading branch information
kevinhalliday authored Feb 29, 2024
1 parent 297cc91 commit 79698d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/site/docs/develop/xapp/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ function xcall(uint64 destChainId, address to, bytes memory data, uint64 gasLimi
}
```

Note that `XApp.xcall(...)` returns the fee charged. This lets you charge users for fees, rather than paying fees from your contract.
`xcall(...)` charges fees to your contract by default. To charge users for fees, calculate the fee with `feeFor(...)`, and verify `msg.value` is sufficient.

```solidity
uint256 fee = xcall(...)
uint256 fee = feeFor(...)
require(msg.value >= fee, "insufficient fee")
```

Expand Down

0 comments on commit 79698d3

Please sign in to comment.