-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
942 additions
and
94 deletions.
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
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
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
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
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
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,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> | ||
|
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,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. | ||
|
Oops, something went wrong.