Skip to content

Commit

Permalink
npx hardhat docgen
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Mar 11, 2024
1 parent 2ee4438 commit 2f78c4b
Show file tree
Hide file tree
Showing 24 changed files with 942 additions and 94 deletions.
21 changes: 21 additions & 0 deletions docs/evm/Zeta.non-eth.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Source: https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm

* [Minted(mintee, amount, internalSendHash)](#ZetaNonEth-Minted-address-uint256-bytes32-)
* [Burnt(burnee, amount)](#ZetaNonEth-Burnt-address-uint256-)
* [TSSAddressUpdated(callerAddress, newTssAddress)](#ZetaNonEth-TSSAddressUpdated-address-address-)
* [TSSAddressUpdaterUpdated(callerAddress, newTssUpdaterAddress)](#ZetaNonEth-TSSAddressUpdaterUpdated-address-address-)
* [ConnectorAddressUpdated(callerAddress, newConnectorAddress)](#ZetaNonEth-ConnectorAddressUpdated-address-address-)

* [Transfer(from, to, value)](#IERC20-Transfer-address-address-uint256-)
* [Approval(owner, spender, value)](#IERC20-Approval-address-address-uint256-)
Expand Down Expand Up @@ -81,6 +84,24 @@ Burnt(address indexed burnee, uint256 amount) (event)

<a name="ZetaNonEth-Burnt-address-uint256-"></a>

```
TSSAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaNonEth-TSSAddressUpdated-address-address-"></a>

```
TSSAddressUpdaterUpdated(address callerAddress, address newTssUpdaterAddress) (event)
```

<a name="ZetaNonEth-TSSAddressUpdaterUpdated-address-address-"></a>

```
ConnectorAddressUpdated(address callerAddress, address newConnectorAddress) (event)
```

<a name="ZetaNonEth-ConnectorAddressUpdated-address-address-"></a>

```
Transfer(address indexed from, address indexed to, uint256 value) (event)
```
Expand Down
15 changes: 11 additions & 4 deletions docs/evm/ZetaConnector.base.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ There's an instance of this contract on each chain supported by ZetaChain.
* [ZetaSent(sourceTxOriginAddress, zetaTxSenderAddress, destinationChainId, destinationAddress, zetaValueAndGas, destinationGasLimit, message, zetaParams)](#ZetaConnectorBase-ZetaSent-address-address-uint256-bytes-uint256-uint256-bytes-bytes-)
* [ZetaReceived(zetaTxSenderAddress, sourceChainId, destinationAddress, zetaValue, message, internalSendHash)](#ZetaConnectorBase-ZetaReceived-bytes-uint256-address-uint256-bytes-bytes32-)
* [ZetaReverted(zetaTxSenderAddress, sourceChainId, destinationChainId, destinationAddress, remainingZetaValue, message, internalSendHash)](#ZetaConnectorBase-ZetaReverted-address-uint256-uint256-bytes-uint256-bytes-bytes32-)
* [TSSAddressUpdated(zetaTxSenderAddress, newTssAddress)](#ZetaConnectorBase-TSSAddressUpdated-address-address-)
* [PauserAddressUpdated(updaterAddress, newTssAddress)](#ZetaConnectorBase-PauserAddressUpdated-address-address-)
* [TSSAddressUpdated(callerAddress, newTssAddress)](#ZetaConnectorBase-TSSAddressUpdated-address-address-)
* [TSSAddressUpdaterUpdated(callerAddress, newTssUpdaterAddress)](#ZetaConnectorBase-TSSAddressUpdaterUpdated-address-address-)
* [PauserAddressUpdated(callerAddress, newTssAddress)](#ZetaConnectorBase-PauserAddressUpdated-address-address-)

* [Paused(account)](#Pausable-Paused-address-)
* [Unpaused(account)](#Pausable-Unpaused-address-)
Expand Down Expand Up @@ -172,13 +173,19 @@ ZetaReverted(address zetaTxSenderAddress, uint256 sourceChainId, uint256 indexed
<a name="ZetaConnectorBase-ZetaReverted-address-uint256-uint256-bytes-uint256-bytes-bytes32-"></a>

```
TSSAddressUpdated(address zetaTxSenderAddress, address newTssAddress) (event)
TSSAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaConnectorBase-TSSAddressUpdated-address-address-"></a>

```
PauserAddressUpdated(address updaterAddress, address newTssAddress) (event)
TSSAddressUpdaterUpdated(address callerAddress, address newTssUpdaterAddress) (event)
```

<a name="ZetaConnectorBase-TSSAddressUpdaterUpdated-address-address-"></a>

```
PauserAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaConnectorBase-PauserAddressUpdated-address-address-"></a>
Expand Down
15 changes: 11 additions & 4 deletions docs/evm/ZetaConnector.eth.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ This version is only for Ethereum network because in the other chains we mint an
* [ZetaSent(sourceTxOriginAddress, zetaTxSenderAddress, destinationChainId, destinationAddress, zetaValueAndGas, destinationGasLimit, message, zetaParams)](#ZetaConnectorBase-ZetaSent-address-address-uint256-bytes-uint256-uint256-bytes-bytes-)
* [ZetaReceived(zetaTxSenderAddress, sourceChainId, destinationAddress, zetaValue, message, internalSendHash)](#ZetaConnectorBase-ZetaReceived-bytes-uint256-address-uint256-bytes-bytes32-)
* [ZetaReverted(zetaTxSenderAddress, sourceChainId, destinationChainId, destinationAddress, remainingZetaValue, message, internalSendHash)](#ZetaConnectorBase-ZetaReverted-address-uint256-uint256-bytes-uint256-bytes-bytes32-)
* [TSSAddressUpdated(zetaTxSenderAddress, newTssAddress)](#ZetaConnectorBase-TSSAddressUpdated-address-address-)
* [PauserAddressUpdated(updaterAddress, newTssAddress)](#ZetaConnectorBase-PauserAddressUpdated-address-address-)
* [TSSAddressUpdated(callerAddress, newTssAddress)](#ZetaConnectorBase-TSSAddressUpdated-address-address-)
* [TSSAddressUpdaterUpdated(callerAddress, newTssUpdaterAddress)](#ZetaConnectorBase-TSSAddressUpdaterUpdated-address-address-)
* [PauserAddressUpdated(callerAddress, newTssAddress)](#ZetaConnectorBase-PauserAddressUpdated-address-address-)

* [Paused(account)](#Pausable-Paused-address-)
* [Unpaused(account)](#Pausable-Unpaused-address-)
Expand Down Expand Up @@ -104,13 +105,19 @@ ZetaReverted(address zetaTxSenderAddress, uint256 sourceChainId, uint256 indexed
<a name="ZetaConnectorBase-ZetaReverted-address-uint256-uint256-bytes-uint256-bytes-bytes32-"></a>

```
TSSAddressUpdated(address zetaTxSenderAddress, address newTssAddress) (event)
TSSAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaConnectorBase-TSSAddressUpdated-address-address-"></a>

```
PauserAddressUpdated(address updaterAddress, address newTssAddress) (event)
TSSAddressUpdaterUpdated(address callerAddress, address newTssUpdaterAddress) (event)
```

<a name="ZetaConnectorBase-TSSAddressUpdaterUpdated-address-address-"></a>

```
PauserAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaConnectorBase-PauserAddressUpdated-address-address-"></a>
Expand Down
23 changes: 19 additions & 4 deletions docs/evm/ZetaConnector.non-eth.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ This version is for every chain but Etherum network because in the other chains

### Event List

* [MaxSupplyUpdated(callerAddress, newMaxSupply)](#ZetaConnectorNonEth-MaxSupplyUpdated-address-uint256-)

* [ZetaSent(sourceTxOriginAddress, zetaTxSenderAddress, destinationChainId, destinationAddress, zetaValueAndGas, destinationGasLimit, message, zetaParams)](#ZetaConnectorBase-ZetaSent-address-address-uint256-bytes-uint256-uint256-bytes-bytes-)
* [ZetaReceived(zetaTxSenderAddress, sourceChainId, destinationAddress, zetaValue, message, internalSendHash)](#ZetaConnectorBase-ZetaReceived-bytes-uint256-address-uint256-bytes-bytes32-)
* [ZetaReverted(zetaTxSenderAddress, sourceChainId, destinationChainId, destinationAddress, remainingZetaValue, message, internalSendHash)](#ZetaConnectorBase-ZetaReverted-address-uint256-uint256-bytes-uint256-bytes-bytes32-)
* [TSSAddressUpdated(zetaTxSenderAddress, newTssAddress)](#ZetaConnectorBase-TSSAddressUpdated-address-address-)
* [PauserAddressUpdated(updaterAddress, newTssAddress)](#ZetaConnectorBase-PauserAddressUpdated-address-address-)
* [TSSAddressUpdated(callerAddress, newTssAddress)](#ZetaConnectorBase-TSSAddressUpdated-address-address-)
* [TSSAddressUpdaterUpdated(callerAddress, newTssUpdaterAddress)](#ZetaConnectorBase-TSSAddressUpdaterUpdated-address-address-)
* [PauserAddressUpdated(callerAddress, newTssAddress)](#ZetaConnectorBase-PauserAddressUpdated-address-address-)

* [Paused(account)](#Pausable-Paused-address-)
* [Unpaused(account)](#Pausable-Unpaused-address-)
Expand Down Expand Up @@ -94,6 +97,12 @@ To perform the transfer mint new tokens, validating first the maxSupply allowed

### Events

```
MaxSupplyUpdated(address callerAddress, uint256 newMaxSupply) (event)
```

<a name="ZetaConnectorNonEth-MaxSupplyUpdated-address-uint256-"></a>

```
ZetaSent(address sourceTxOriginAddress, address indexed zetaTxSenderAddress, uint256 indexed destinationChainId, bytes destinationAddress, uint256 zetaValueAndGas, uint256 destinationGasLimit, bytes message, bytes zetaParams) (event)
```
Expand All @@ -113,13 +122,19 @@ ZetaReverted(address zetaTxSenderAddress, uint256 sourceChainId, uint256 indexed
<a name="ZetaConnectorBase-ZetaReverted-address-uint256-uint256-bytes-uint256-bytes-bytes32-"></a>

```
TSSAddressUpdated(address zetaTxSenderAddress, address newTssAddress) (event)
TSSAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaConnectorBase-TSSAddressUpdated-address-address-"></a>

```
PauserAddressUpdated(address updaterAddress, address newTssAddress) (event)
TSSAddressUpdaterUpdated(address callerAddress, address newTssUpdaterAddress) (event)
```

<a name="ZetaConnectorBase-TSSAddressUpdaterUpdated-address-address-"></a>

```
PauserAddressUpdated(address callerAddress, address newTssAddress) (event)
```

<a name="ZetaConnectorBase-PauserAddressUpdated-address-address-"></a>
Expand Down
7 changes: 7 additions & 0 deletions docs/evm/interfaces/ZetaInterfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The interface can be implemented using different strategies, like UniswapV2, Uni
* [getZetaFromToken(destinationAddress, minAmountOut, inputToken, inputTokenAmount)](#ZetaTokenConsumer-getZetaFromToken-address-uint256-address-uint256-)
* [getEthFromZeta(destinationAddress, minAmountOut, zetaTokenAmount)](#ZetaTokenConsumer-getEthFromZeta-address-uint256-uint256-)
* [getTokenFromZeta(destinationAddress, minAmountOut, outputToken, zetaTokenAmount)](#ZetaTokenConsumer-getTokenFromZeta-address-uint256-address-uint256-)
* [hasZetaLiquidity()](#ZetaTokenConsumer-hasZetaLiquidity--)

### Event List

Expand Down Expand Up @@ -123,6 +124,12 @@ getTokenFromZeta(address destinationAddress, uint256 minAmountOut, address outpu

<a name="ZetaTokenConsumer-getTokenFromZeta-address-uint256-address-uint256-"></a>

```
hasZetaLiquidity() → bool (external function)
```

<a name="ZetaTokenConsumer-hasZetaLiquidity--"></a>

### Events

```
Expand Down
100 changes: 100 additions & 0 deletions docs/evm/testing/AttackerContract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
## Victim

```solidity
import "@zetachain/protocol-contracts/contracts/evm/testing/AttackerContract.sol";
```

Source: https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/testing/AttackerContract.sol

### Function List

* [deposit(recipient, asset, amount, message)](#Victim-deposit-bytes-address-uint256-bytes-)
* [withdraw(recipient, asset, amount)](#Victim-withdraw-address-address-uint256-)

### Modifiers

### Functions

```
deposit(bytes recipient, address asset, uint256 amount, bytes message) (external function)
```

<a name="Victim-deposit-bytes-address-uint256-bytes-"></a>

```
withdraw(address recipient, address asset, uint256 amount) (external function)
```

<a name="Victim-withdraw-address-address-uint256-"></a>

## AttackerContract

```solidity
import "@zetachain/protocol-contracts/contracts/evm/testing/AttackerContract.sol";
```

Source: https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/testing/AttackerContract.sol

### Function List

* [constructor(victimContractAddress_, wzeta, victimMethod)](#AttackerContract-constructor-address-address-uint256-)
* [receive()](#AttackerContract-receive--)
* [attackDeposit()](#AttackerContract-attackDeposit--)
* [attackWidrawal()](#AttackerContract-attackWidrawal--)
* [attack()](#AttackerContract-attack--)
* [balanceOf(account)](#AttackerContract-balanceOf-address-)
* [transferFrom(from, to, amount)](#AttackerContract-transferFrom-address-address-uint256-)
* [transfer(to, amount)](#AttackerContract-transfer-address-uint256-)

### Modifiers

### Functions

```
constructor(address victimContractAddress_, address wzeta, uint256 victimMethod) (public function)
```

<a name="AttackerContract-constructor-address-address-uint256-"></a>

```
receive() (external function)
```

<a name="AttackerContract-receive--"></a>

```
attackDeposit() (internal function)
```

<a name="AttackerContract-attackDeposit--"></a>

```
attackWidrawal() (internal function)
```

<a name="AttackerContract-attackWidrawal--"></a>

```
attack() (internal function)
```

<a name="AttackerContract-attack--"></a>

```
balanceOf(address account) → uint256 (external function)
```

<a name="AttackerContract-balanceOf-address-"></a>

```
transferFrom(address from, address to, uint256 amount) → bool (public function)
```

<a name="AttackerContract-transferFrom-address-address-uint256-"></a>

```
transfer(address to, uint256 amount) → bool (public function)
```

<a name="AttackerContract-transfer-address-uint256-"></a>

51 changes: 51 additions & 0 deletions docs/evm/testing/ERC20Mock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## ERC20Mock

```solidity
import "@zetachain/protocol-contracts/contracts/evm/testing/ERC20Mock.sol";
```

Source: https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/testing/ERC20Mock.sol

ZetaEth is an implementation of OpenZeppelin's ERC20

### Function List

* [constructor(name, symbol, creator, initialSupply)](#ERC20Mock-constructor-string-string-address-uint256-)

### Event List

* [Transfer(from, to, value)](#IERC20-Transfer-address-address-uint256-)
* [Approval(owner, spender, value)](#IERC20-Approval-address-address-uint256-)

### Modifiers

### Functions

```
constructor(string name, string symbol, address creator, uint256 initialSupply) (public function)
```

<a name="ERC20Mock-constructor-string-string-address-uint256-"></a>

### Events

```
Transfer(address indexed from, address indexed to, uint256 value) (event)
```

<a name="IERC20-Transfer-address-address-uint256-"></a>

Emitted when `value` tokens are moved from one account (`from`) to
another (`to`).

Note that `value` may be zero.

```
Approval(address indexed owner, address indexed spender, uint256 value) (event)
```

<a name="IERC20-Approval-address-address-uint256-"></a>

Emitted when the allowance of a `spender` for an `owner` is set by
a call to {approve}. `value` is the new allowance.

Loading

0 comments on commit 2f78c4b

Please sign in to comment.