... | @@ -149,15 +149,10 @@ constraints |
... | @@ -149,15 +149,10 @@ constraints |
|
- Mulmod
|
|
- Mulmod
|
|
|
|
|
|
- Normallength
|
|
- Normallength
|
|
|
|
|
|
输入:length,offset,data_size
|
|
输入:length,offset,data_size
|
|
|
|
|
|
输出:normal_length, zero_length
|
|
输出:normal_length, zero_length
|
|
|
|
|
|
计算方式:
|
|
计算方式:
|
|
|
|
|
|
以codecopy为例,length:为要copy的长度,offset为bytecode偏移量(即复制起始位置),data_size为bytecode的总长度
|
|
以codecopy为例,length:为要copy的长度,offset为bytecode偏移量(即复制起始位置),data_size为bytecode的总长度
|
|
|
|
|
|
```rust
|
|
```rust
|
|
fn normal_length(length: u64, offset: u64, data_size: u64) -> (normal_length: u64, zero_length: u64) {
|
|
fn normal_length(length: u64, offset: u64, data_size: u64) -> (normal_length: u64, zero_length: u64) {
|
|
if offset > data_size {
|
|
if offset > data_size {
|
... | | ... | |