Skip to content

Uniswap V2 bugs (WasmEdge Revert) #121

@eee4017

Description

@eee4017
  1. Wasm section size too small
    When copying deploy bytecode, WasmEdge will revert due to OOB
    https://github.com/second-state/uniswap-v2-core/blob/vincent/upgrade_to_solc_0.8.6/contracts/yul/UniswapV2ERC20.yul#L18

This error could be solved by assigning larger memory secion to wasm-ld

wasm-ld --entry main --gc-sections --allow-undefined --export=__heap_base --max-memory=16777216 --initial-memory=16777216 UniswapV2ERC20.o -o UniswapV2ERC20.wasm
  1. keccak256 failed
    WasmEdge will revert due to OOB. I guess that this is a bug in keccak256 implementation.
    https://github.com/second-state/uniswap-v2-core/blob/vincent/upgrade_to_solc_0.8.6/contracts/yul/UniswapV2ERC20.yul#L138

The behavior here is strange, since WasmEdge would not stop at the OOB occurs.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions