Open ligi opened 6 years ago
@ligi another thing that I would like to know is how to select what is the module name for each symbol, because 1) the module that should be included is called "ethereum" and 2) even if we can't get rid of all the Konan_
symbols then they will be provided by an auxiliary module that won't provide functions like getTxOrigin
.
As an intermediate solution, it would be possible to have:
write
as a function that does nothingabort
and Konan_abort
as functions that call revert
Konan_notify_memory_grow
as a function that either does nothing or belongs to a kotlin
module that exports memory
:
(module
(type $0 (func)
# Best guess as to what the max mem will be
(memory $0 256)
(export "memory" (memory $0))
(export "Konan_notify_memory_grow (func $0))
(func $0 (type $0)
(nop)
)
)
currently the import section looks like this:
Create this file by building via
./gradlew wat
These Konan_ imports need to vanish - so it can be used in the eWasm context. The import section must look like this (taken from https://github.com/lrettig/wrc20-challenge/blob/master/build/main.wat):
Also we must find a way to change the module source from "env" to "etheruem" - but this is the easier part as far as I see, I have seen this just being replaced in build-scripts. But it would be nicer if we could specify it when declaring the import in eei.kt like this:
Perhaps there is a way to also specify the module there.