-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generated markdown #42
Open
yorhodes
wants to merge
4
commits into
main
Choose a base branch
from
sol-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apis-and-sdks/building-applications/core-solidity-sdk/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Hyperlane Solidity | ||
|
||
On-chain implementations of Hyperlane in Solidity. | ||
|
||
## Setup | ||
|
||
- `yarn install` | ||
|
||
## Build | ||
|
||
- `yarn build` | ||
|
||
## Test | ||
|
||
- `yarn test` |
124 changes: 124 additions & 0 deletions
124
...ng-applications/core-solidity-sdk/contracts/GasRouter.sol/abstract.GasRouter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
# GasRouter | ||
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/60f321f452052881dce4e22999022e11fc117456/contracts/GasRouter.sol) | ||
|
||
**Inherits:** | ||
[Router](/contracts/Router.sol/abstract.Router.md) | ||
|
||
|
||
## State Variables | ||
### destinationGas | ||
|
||
```solidity | ||
mapping(uint32 => uint256) public destinationGas; | ||
``` | ||
|
||
|
||
## Functions | ||
### setDestinationGas | ||
|
||
Sets the gas amount dispatched for each configured domain. | ||
|
||
|
||
```solidity | ||
function setDestinationGas(GasRouterConfig[] calldata gasConfigs) external onlyOwner; | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`gasConfigs`|`GasRouterConfig[]`|The array of GasRouterConfig structs| | ||
|
||
|
||
### quoteGasPayment | ||
|
||
Returns the gas payment required to dispatch a message to the given domain's router. | ||
|
||
|
||
```solidity | ||
function quoteGasPayment(uint32 _destinationDomain) external view returns (uint256 _gasPayment); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`_destinationDomain`|`uint32`|The domain of the router.| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`_gasPayment`|`uint256`|Payment computed by the registered InterchainGasPaymaster.| | ||
|
||
|
||
### _setDestinationGas | ||
|
||
|
||
```solidity | ||
function _setDestinationGas(uint32 domain, uint256 gas) internal; | ||
``` | ||
|
||
### _dispatchWithGas | ||
|
||
Dispatches a message to an enrolled router via the local router's Mailbox | ||
and pays for it to be relayed to the destination. | ||
|
||
*Uses the destinationGas mapping to populate the gas amount for the message.* | ||
|
||
*Reverts if there is no enrolled router for _destinationDomain.* | ||
|
||
|
||
```solidity | ||
function _dispatchWithGas( | ||
uint32 _destinationDomain, | ||
bytes memory _messageBody, | ||
uint256 _gasPayment, | ||
address _gasPaymentRefundAddress | ||
) internal returns (bytes32 _messageId); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`_destinationDomain`|`uint32`|The domain of the chain to which to send the message.| | ||
|`_messageBody`|`bytes`|Raw bytes content of message.| | ||
|`_gasPayment`|`uint256`|The amount of native tokens to pay for the message to be relayed.| | ||
|`_gasPaymentRefundAddress`|`address`|The address to refund any gas overpayment to.| | ||
|
||
|
||
### _dispatchWithGas | ||
|
||
*Passes `msg.value` as gas payment and `msg.sender` as gas payment refund address.* | ||
|
||
*Uses the destinationGas mapping to populate the gas amount for the message.* | ||
|
||
|
||
```solidity | ||
function _dispatchWithGas(uint32 _destinationDomain, bytes memory _messageBody) internal returns (bytes32 _messageId); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`_destinationDomain`|`uint32`|The domain of the chain to send the message.| | ||
|`_messageBody`|`bytes`|Raw bytes content of message.| | ||
|
||
|
||
## Events | ||
### DestinationGasSet | ||
Emitted when a domain's destination gas is set. | ||
|
||
|
||
```solidity | ||
event DestinationGasSet(uint32 indexed domain, uint256 gas); | ||
``` | ||
|
||
## Structs | ||
### GasRouterConfig | ||
|
||
```solidity | ||
struct GasRouterConfig { | ||
uint32 domain; | ||
uint256 gas; | ||
} | ||
``` | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to move this further down on the side bar, IMO we can't have the protocol section and operators section this far down