Giter Site home page Giter Site logo

Comments (5)

shravanandoria avatar shravanandoria commented on June 12, 2024

@IgorKoval There's no solution provided for this issue in the documentation

from tvm-solidity-compiler.

shravanandoria avatar shravanandoria commented on June 12, 2024

I've removed tvm.accept() from DirectSell Contract, still it's not working & throwing the same error

from tvm-solidity-compiler.

mnill avatar mnill commented on June 12, 2024

Contract was deployed, but constructor function call wasn't successful.

When you deploy contract from contract you've send message with contract code + data and arguments to call constructor function within.

So in case there any issues in constructor function call, contract will be deployed but contructor wasn't successfuly called and you can not call any function before successful constructor function call.

Just look at first transaction on DirectSell.tsol to figure out what error code it has (look both on action and compute phase).

In your case, you've tried to reverse tvm.rawReserve(0.5 ever, 0) on children contract but only attach 0.5 ever when deploy.
You'll pay for sending deploy message + gas for constructior call and after it you will not have enough value to reserve - constructor call failed.

from tvm-solidity-compiler.

shravanandoria avatar shravanandoria commented on June 12, 2024

Hey, that worked!!!! @mnill
but there's one thing I'm still struggling with.

Which flag should I use to reserve tokens.

if I use tvm.rawreserve with flag 0, whole contract's balance get's transferred to msg.sender, which is wrong

if I use tvm.rawreserve with flag 4, msg.value gets added to contract & child contract doesn't get deployed.

HOW CAN I SOLVE THIS!!!!

I WANT USER TO PAY FOR DEPLOYING CHILD CONTRACT & REVERSE SOME TOKENS IN THE CONTRACT, ONLY REMAINING BALANCE WHICH IS LEFT AFTER RESERVING & DEPLOYING CHILD CONTRACT SHOULD BE RETURNED TO MSG.SENDER

image

from tvm-solidity-compiler.

mnill avatar mnill commented on June 12, 2024

I think such a question is not related to the compiler, and it's better to use Discord or Telegram groups to find an answer.

However, tmv.rawReserve(0.5 ever, 0) will hold 0.5 ever on your contract balance. So if there was more than 0.5 ever, the client will receive everything greater than 0.5 ever. If there was less than 0.5 ever, necessary this amount will be deducted from msg.value.

tmv.rawReserve(0.5 ever, 4) will hold the account balance plus 0.5 ever, which is deducted from msg.value.

from tvm-solidity-compiler.

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.