Skip to content

Commit

Permalink
fix 45 Timelock
Browse files Browse the repository at this point in the history
  • Loading branch information
AmazingAng committed Aug 13, 2022
1 parent 401f7a5 commit d9e76e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion 45_Timelock/Timelock.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.4;


contract Timelock{
// 事件
// 交易取消事件
Expand Down
6 changes: 5 additions & 1 deletion 45_Timelock/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ address target, uint256 value, string memory signature, bytes memory data, uint2
- `target`:因为调用的是`Timelock`自己的函数,填入合约地址。
- `value`:不用转入ETH,这里填`0`
- `signature``changeAdmin()`的函数签名为:`"changeAdmin(address)"`
- `data`:这里填要传入的参数,也就是新管理员的地址。但是要把地址填充为32字节的数据,以满足[以太坊ABI编码标准](https://github.com/AmazingAng/WTFSolidity/blob/main/27_ABIEncode/readme.md)。可以使用[hashex](https://abi.hashex.org/)网站进行参数的ABI编码。
- `data`:这里填要传入的参数,也就是新管理员的地址。但是要把地址填充为32字节的数据,以满足[以太坊ABI编码标准](https://github.com/AmazingAng/WTFSolidity/blob/main/27_ABIEncode/readme.md)。可以使用[hashex](https://abi.hashex.org/)网站进行参数的ABI编码。例子:
```solidity
编码前地址:0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2
编码后地址:0x000000000000000000000000ab8483f64d9c6d1ecf9b849ae677dd3315835cb2
```
- `executeTime`:先调用`getBlockTimestamp()`得到当前区块链时间,再在它的基础上加个150秒填入。


Expand Down

0 comments on commit d9e76e0

Please sign in to comment.