Public
Edited
Jan 24, 2023
Insert cell
Insert cell
Insert cell
require('@remix-project/remix-url-resolver@0.0.43/src/index.js').catch(() => window["resolve_1"])
Insert cell
fidm = require('https://bundle.run/@fidm/x509@1.2.1')
Insert cell
window["resolve_1"]
Insert cell
Buffer = require('https://bundle.run/Buffer@0.0.0')
Insert cell
bytesC = {
let initB = Buffer.from(eeditor, 'hex');
let initB2 = Buffer.from(eeditor, 'hex');
//console.log(initB,initB2)
for (let i = 0 ; i < initB.length; i++){
//console.log(i, initB[i]);
if (initB[i-1] == 243 && initB[i] == 254) {
return [initB.slice(0,i+1), initB2.slice(i+1)];
}
}
}
Insert cell
wastD = {
return evm2wast(bytesC[1].toString(),{ addFuncs: [evm2wast(bytesC[0].toString(),{deploy:true,addFuncs:[]})]})
}
Insert cell
evm2wast(bytesC[0].toString(),{deploy:true,addFuncs:[]})
Insert cell
Insert cell
instance.exports
Insert cell
wabt
Insert cell
evm2wast(eeditor)
Insert cell
instance.exports
Insert cell
Insert cell
Insert cell
Insert cell
fxgen = function(ar){
return ()=>{
console.log(ar);
}
}
Insert cell
module = {
var modu = binaryen.parseText(editor)
return modu;
}
Insert cell
//module.emitAsmjs()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function assembleInstantiate (segments) {
let wasm = buildJumpMap(segments)

segments.forEach((seg, index) => {
wasm = `(block $${index + 1} ${wasm}`
})

return `
(func $instantiate
(export "instantiate")
(local $jump_dest i32) (local $jump_map_switch i32)
(call $initCalldata)
(local.set $jump_dest (i32.const -1))

(block $done
(loop $loop
${wasm}`
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
wabt = new wabt1()
Insert cell
BNm = import('https://cdn.skypack.dev/bn.js@5.2.1?min')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
wastSyncInterface = FileAttachment("wast@1.json").json()
Insert cell
wastAsyncInterface = FileAttachment("wast-async@2.json").json()
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more