Code Monkey home page Code Monkey logo

Comments (5)

davidyuk avatar davidyuk commented on July 26, 2024 2

I will draft a PR today/tomorrow

from aepp-calldata-js.

dincho avatar dincho commented on July 26, 2024

@davidyuk can you help here getting more lib specific reproduction steps?

from aepp-calldata-js.

davidyuk avatar davidyuk commented on July 26, 2024

Sure!

import { BytecodeContractCallEncoder } from './src/main.js';

const response = await fetch(`https://testnet.aeternity.io/v3/contracts/ct_7NTLakadL7cQ4X3EcXYmec5p3QYgAEA6DDqYBMwH5ZZ2U2k5L/code`);
const { bytecode } = await response.json();

const bytecodeContractCallEncoder = new BytecodeContractCallEncoder(bytecode);
const value = bytecodeContractCallEncoder.decodeCall('cb_KxEV1igBG2+IDeC2s6dj/8DKjvSn'); // copied from SW confirmation window
console.log(value);

0b10001111 introduced in aeternity/aebytecode#94

from aepp-calldata-js.

davidyuk avatar davidyuk commented on July 26, 2024

More concrete reproduction

import { BytecodeContractCallEncoder } from './src/main.js';

const bytecodeContractCallEncoder = new BytecodeContractCallEncoder(
    'cb_+NBGA6D+x/gUE1YYLmvMJDIzJK2ZFJyOM5sXubwJy+9TVt/ib8C4n7iE/kTWRB8ANwA3ABoOgj8BAz/+m66dXgA3AQdHAgwBAAwDAAwDNwEHDAOPbxX4U0YDoJg7mklGIIWH49uiZBksC7yUEVO88y4D7lTd8+T4TMK2wKOS/kTWRB8ANwEHNwAaBoIAAQM/jC8BEUTWRB8RaW5pdIIvAIk4LjAuMC1yYzEAowAAlS8CEUTWRB8RaW5pdBGbrp1eDW5ld4IvAIk4LjAuMC1yYzEAaSb5ng==',
);

console.log(bytecodeContractCallEncoder._internalEncoder._typeResolver._bytecode)
contract IntHolder =
  type state = int
  entrypoint init(x) = x
  
main contract IntHolderFactory =
  stateful entrypoint new(x : int) : IntHolder =
    Chain.create(x)

from aepp-calldata-js.

dincho avatar dincho commented on July 26, 2024

Thanks @davidyuk

from aepp-calldata-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.