by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 25 20:51
    eggplantzzz synchronize #3395
  • Sep 25 20:51

    eggplantzzz on move-test-files

    Add better logging to the test (compare)

  • Sep 25 20:35

    haltman-at on no-comment

    (compare)

  • Sep 25 20:35

    haltman-at on develop

    Update doc comment about extern… Merge pull request #3401 from t… (compare)

  • Sep 25 20:35
    haltman-at closed #3401
  • Sep 25 20:35

    haltman-at on linit

    (compare)

  • Sep 25 20:34

    haltman-at on develop

    Resolve linting problems in var… Merge pull request #3400 from t… (compare)

  • Sep 25 20:34
    haltman-at closed #3400
  • Sep 25 20:30
    eggplantzzz synchronize #3395
  • Sep 25 20:30

    eggplantzzz on move-test-files

    Update tests to log the error w… (compare)

  • Sep 25 19:53
    eggplantzzz synchronize #3395
  • Sep 25 19:53

    eggplantzzz on move-test-files

    Correct another path (compare)

  • Sep 25 19:26
    haltman-at review_requested #3401
  • Sep 25 19:26
    haltman-at review_requested #3401
  • Sep 25 19:26
    haltman-at review_requested #3401
  • Sep 25 19:26
    haltman-at opened #3401
  • Sep 25 19:23

    haltman-at on no-comment

    Update doc comment about extern… (compare)

  • Sep 25 18:39
    eggplantzzz synchronize #3395
  • Sep 25 18:39

    eggplantzzz on move-test-files

    Correct a couple more paths (compare)

  • Sep 25 18:38
    haltman-at review_requested #3400
Will Perone
@MegaManSE
I'm able to mint/burn in web3 just not in here
finally got that part working
tyler
@eggplantzzz
I'll be happy to look at your project and try to troubleshoot if you have it somewhere online
Will Perone
@MegaManSE
it's not on github currently
still very early phase
tyler
@eggplantzzz
Well, what you are doing there should work
Will Perone
@MegaManSE
ok
hm
is there a way to get the token symbol from the web3 side?
nevermind I can do it
tyler
@eggplantzzz
I assume there is an error somewhere else in your project as the above looks correct
Steffel
@steffenix
I am trying to use truffle debug
Starting Truffle Debugger...
✔ Fetching solc version list from solc-bin. Attempt #1
✔ Fetching solc version list from solc-bin. Attempt #1
✔ Compiling your contracts...
✔ Gathering information about your project...
TypeError: Cannot destructure property 'id' of 'source' as it is undefined.
    at new DebugPrinter (/Users/perso/.asdf/installs/nodejs/12.18.4/.npm/lib/node_modules/truffle/build/webpack:/packages/core/lib/debug/printer.js:51:16)
    at new DebugInterpreter (/Users/perso/.asdf/installs/nodejs/12.18.4/.npm/lib/node_modules/truffle/build/webpack:/packages/core/lib/debug/interpreter.js:40:1)
    at CLIDebugger.buildInterpreter (/Users/perso/.asdf/installs/nodejs/12.18.4/.npm/lib/node_modules/truffle/build/webpack:/packages/core/lib/debug/cli.js:150:1)
    at CLIDebugger.run (/Users/perso/.asdf/installs/nodejs/12.18.4/.npm/lib/node_modules/truffle/build/webpack:/packages/core/lib/debug/cli.js:34:1)
    at /Users/perso/.asdf/installs/nodejs/12.18.4/.npm/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/debug.js:55:1
Truffle v5.1.45 (core: 5.1.45)
Node v12.18.4
tyler
@eggplantzzz
@steffenix Hmm, maybe you found a bug. Can you provide reproduction steps? Consider creating an issue on GitHub.
0xc0de4c0ffee
@0xc0de4c0ffee

Help!
I think truffle/test isn't handling overloaded functions properly.

    function f(uint8 _in) public pure returns (uint8 out) {
        out = _in;
    }

    function f(uint256 _in) public pure returns (uint256 out) {
        out = _in;
    }

    function f(uint160 _a, uint160 _b) public pure returns (uint160 out) {
        out = (_a + _b);
    }

Error: Invalid number of parameters for "f". Got 2 expected 1!

https://solidity.readthedocs.io/en/v0.7.1/contracts.html#function-overloading
I remember this error during v5 migration & there was an open issue related to this error.. I thought it was resolved.

Thanks to team,
using instance.methods for overloaded function is good enough for tests..

const instance = await MyContract.deployed();
instance.methods['setValue(uint256)'](123);
instance.methods['setValue(uint256,uint256)'](11, 55);

https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts#invoking-overloaded-methods

Steffel
@steffenix
@eggplantzzz Is there a way to use truffle from the source and not the webpacked version?
tyler
@eggplantzzz
you can run packages/core/cli.js.
So say you want to run the compile function, run something like ./packages/core/cli.js compile --all
Steffel
@steffenix
I want to run it from my project, I have imported truffle with: "truffle": "^5.1.45"
And I have a
  "scripts": {
    "debug": "truffle debug"
  },
tyler
@eggplantzzz
You could do
"scripts": {
  "debug": "../<pathToTruffleDir>/packages/core/cli.js debug"
}
or something like that - a bit hacky but I guess it would work
Will Perone
@MegaManSE
Do we need to deploy the other contracts also or just the main one?
in ganache it shows a list of all the imported openzeppelin contracts in my contract and it says they are not deployed
do I also need to deploy those?
I can't find any notes on that
Steffel
@steffenix

@eggplantzzz
I have aded a log
console.log(compilation)

And indeed one file seems to cause some issues

 {
....
    },
    compiler: {
      name: 'solc',
      version: '0.6.12+commit.27d51765.Emscripten.clang'
    },
    id: '0',
    compilationId: 'shimmedCompilationNumber(0)'
  },
  <1 empty item>,
....
Will Perone
@MegaManSE
Getting farther...
Now when deploying to ropsten I get
C:\Users\Will\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\merkle-patricia-tree\node_modules\async\lib\async.js:358
                callback(err);
^
Error: Callback was already called.
    at C:\Users\Will\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\merkle-patricia-tree\node_modules\async\lib\async.js:43:1
    at WriteStream.<anonymous> (C:\Users\Will\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\merkle-patricia-tree\node_modules\async\lib\async.js:358:1)
    at WriteStream.emit (events.js:314:20)
    at WriteStream.destroy (C:\Users\Will\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\level-ws\level-ws.js:140:1)
    at finish (_stream_writable.js:670:14)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Will Perone
@MegaManSE
needed the --skipDryRun
saw your comment on that thread @eggplantzzz
doplumi
@doplumi
hi guys, truffle can't deploy a contract because it says it's too large. Remix does the same but when I enable compile optimization it works. On truffle it doesn't, even with optimization enabled and on the same version of the compiler. What else could I check?
swkim109
@swkim109
Can I set solc to multiple versions of compilers in truffle-config.js? Like this:
compilers: {
    solc: {
      version: ">=0.5.0 <0.7.0",
g. nicholas d'andrea
@gnidan
@swkim109 yep that works, but note that truffle only uses one version of solc at a time. in your example, truffle will use solc@0.6.12
swkim109
@swkim109
@gnidan if source files have different pragma each other(some have ^0.5.0 others ^0.6.12), truffle compile does not compile?
And why 0.6.12?
Ivaangelicrypto
@ivaangelic_twitter
Guys quick question I'm dabbling
With truffle petshop
Now so the contract compiles properly
When I test
None of the assertions.sol or other test sol get deployed
Is it because I should only test solidity first and then do the javascript test
Just curious
Or in the initial migrations I have to mention the path of thr assertions and other test contracts as well
Why I run tests only the migration contract gets deployed and not the assertions or any of the imports
cjd9s
@cjd9s
@doplumi Hey. The maximum size of a contract (aka bytecode creation limit) was introduced in eip-170. That limit is 0x6000 (214 + 213) bytes or 24,576 bytes. It might be worth directly checking the actual size of the bytecode using a command-line JSON processor like jq. Once you download it, you can use the following command: jq-win64 ".deployedBytecode | length / 2 - 1" build/contracts/YourContractNameGoesHere.json. This will give you the size of your bytecode. Hope that helps. Cheers.
g. nicholas d'andrea
@gnidan
@swkim109 0.6.12 because that's the highest version before 0.7.0. unfortunately your situation won't work - if you have some contracts that need 0.5.0 and some that need 0.6.0, there's nothing you can do about it in truffle right now. this is something we're actively working on: trufflesuite/truffle#2021
Will Perone
@MegaManSE
Does anyone know how to properly estimate gas price and limit for a signed transaction? I'm getting all sorts of weird errors when I tried different ways to calculate it.
Error: Transaction has been reverted by the EVM
Error: Returned error: gas required exceeds allowance (8000000) or always failing transaction
etc
I've tried
await web3.eth.getGasPrice()
await web3.eth.estimateGas({ from: rawTransaction.from, nonce: rawTransaction.nonce, to: rawTransaction.to, data: rawTransaction.data });
Will Perone
@MegaManSE
Returned error: exceeds block gas limit