Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    This will help you to check which statements were covered
    Xiao Liang
    @balajipachai Thanks for your reply. I am aware of solidity-coverage. However, it's meant to generate coverage report for Truffle test cases, not a generic transaction...
    Damian Lluch

    Hi guys. I developed a SC with Solidity and I have a script that loads the blockchain with test data and when execute first time, It's ok, but when execute other times I get this message:

    VM Exception while processing transaction: revert.

    how can capture this error in try - catch and return my custom message for frontend?.


    this is my code:

    try {
    await deed.create(_serialNumber1, _manufacturer1, _owner1);
    await deed.create(_serialNumber2, _manufacturer2, _owner2);
    await deed.create(_serialNumber3, _manufacturer3, _owner3);
    await deed.create(_serialNumber4, _manufacturer4, _owner4);
    await deed.create(_serialNumber5, _manufacturer5, _owner5);
    await deed.create(_serialNumber6, _manufacturer6, _owner6);
    await deed.create(_serialNumber7, _manufacturer7, _owner7);
    } catch (error) {

    Newer ganache versions return the revert message
    Hi guys, if anyone know where could I find all of the open-source contracts/DAPP/DAO templates?
    Xiao Liang
    What kind of template are you looking for?
    @yxliang01 No limits! I just want to learn until now, how many well VERIFIED open-source contracts/DAPP/DAO templates that fresh can straightly imitates are developed and released? just like ERC20?
    Oluwafemi E. Akinde
    Hello guys. I need some help please
    contract Test {
    function getKeccak256(string memory email) public pure returns (uint256) {
    return uint256(keccak256(email));
    function mint(string memory email) public view returns (uint256) {
    uint256 v = getKeccak256(email);
    return v;
    This is what i want to achieve: I want to mint a uint of the email in the mint().
    So i thought of using the keccak256 function to get the equivalent in the uint by using type casting (because keccak256 returns bytes)
    Oluwafemi E. Akinde
    So the challenge here is that the line return uint256(keccak256(email)); is giving a conversion error
    I basically want to mint an integer based on the email of the user
    Oluwafemi E. Akinde
    Hi guys!
    Oluwafemi E. Akinde
    I got it working already, no worries. Thanks
    hello brothers i need your help...
    i tried my best to learn the concept of mapping in solidity but i did not understand..... kindly explain it to me
    Gaurav Nayyar

    Hi Guys,

    can any one let me know how to call constructor from the test SC while unit testing.

    my smart contract is this ......

    pragma solidity >=0.4.25 <0.6.0;

    contract Lottery
    address public manager;

    address payable[] public player;
     constructor (address manager1) public{
        manager = manager1;
    function addPlayer() public payable
        require(manager!= msg.sender, "player and manager can't be same");
    function getAllPlayer() public view returns ( address payable[] memory) {
        return player;
    function random() private view returns(uint256)
    return  uint256( keccak256(abi.encodePacked(block.difficulty, block.timestamp, player)));
    function pickWinner() public restrited ()
    uint256 index=  random() % player.length;


    player= new address payable;

    modifier restrited()
        require(msg.sender==manager, "winner only be picked by manager");


    Devon Wesley
    Well you could just check if the manager var on the contract instance is what you expect. @Nayyar525
    Devon Wesley
    Any good meetups around Solidity happening in the bay area(San Fransisco, CA) these days?
    Tamaghna Chowdhury

    ETHcode - Smart contract development plugin for VScode

    Compile Solidity and Vyper smart contracts and 1 click Deploy.

    “Ethcode v0.0.9 — Beginning the `20s” https://medium.com/quanta-network/ethcode-v0-0-9-beginning-the-20s-7be98a0b2a01

    oh no activity in this room
    Tamaghna Chowdhury

    Ethcode latest update

    Now you can debug any transaction of Ethereum network (including main and test networks)



    Hi everyone, I also had the same exact error. I was able to solve it by changing the mnemonic in my truffle-config.js to match the mnemonic given by Ganache CLI.

    This is what I used to get when I run npm test

    ` > blockchain-day1@1.0.0 test C:\Users\Noha Abuaesh\Desktop\BCND-C6-Exercises

    truffle test test/ExerciseC6A.js

    Compiling .\contracts\ExerciseC6A.sol...
    Compiling .\contracts\Migrations.sol...
    sender doesn't have enough funds to send tx. The upfront cost is: 672197500000000000 and the sender's account only has: 0
    npm ERR! Test failed. See above for more details. `

    Because each time I run Ganache, the mnemonic changes. but I always forget to change it in the config file to access the funds in the correct account

    Rahul Singh
    Hello guys, I'm working in a use case where a have to send some encrypted transaction from user A to user B. so that only user B can see decrypting data by using his private key, but the thing is I don't want to save users private key on sever.
    could anyone can help me with this.
    Abhishek Kumar

    Hello everyone,
    I have a contract which create erc20 token(contract A), and it is deployed.
    Can I deploy another contract (contract B) which can use that custom token for transaction?

    Or deploying both contract together is the only solution?
    Like inherting contract..

    But if I deploy both contract together,
    then let's say if I want to change (contract B) I will have to deploy the contract A again. I don't think I should mint tokens again and again. Right?

    Emanuel Castillo
    Hey guys
    I got another doubt. Is there already some smartcontract which I can know the ethereum price in dollar? I mean, I want to pay a specific amount of dollars (i.e. US 500) in MEW, but I want that when I to go to pay it, The smartcontract says to the environment how many ethers should send that referee those US500.
    1 reply
    can someone help us to audit a SC?
    1 reply
    Hey all! Please join the new ConsenSys Discord server if you want to chat smart contract best practices with the ConsenSys team & community! https://discord.gg/Ve9sQAX
    anyone know how to get truffle to work with compiler 0.6.0 and above?
    can't seem to use the receive() method as of now
    Hey all
    When I attempt to run tests on my machine via truffle test, the console hangs, then the terminal prompt reappears:
    I do not receive any output or errors. This also occurs with truffle deploy and truffle compile.
    Does anyone know what the issue is?
    hi anyone wanna help me on my project?
    Tamaghna Chowdhury
    Build your Ethereum dApp using Golang and React
    Howard Peng
    Hello, what is here's mean "rate limiting" in practice?
    Stefan Duprey
    dear all, i have an old smart contract which i compiled and deployed using Truffle in 2018 using open-zeppelin. i want to verify and publish the code now. i have all the truffle generated artefacts. but i can't seem to manage to recompile the same byte code. i have used truffle flattener, remix and so on with the same compiler. but the bytecode is always different
    Stefan Duprey
    any help very much appreciated, i can share the reop
    Stefan Duprey
    dear all, i have an old smart contract which i compiled and deployed using Truffle in 2018 using open-zeppelin. i want to verify and publish the code now. i have all the truffle generated artefacts. but i can't seem to manage to recompile the same byte code.
    i managed to get the byte code almost identical up to the last few bytes
    but those differ
    is it possible that i won't manage to reproduce the exact same byte code ?
    Charles Marino
    Probably a different compiler
    Damian Lluch

    Hi, I have a question about which contract to inherit with regard to roles.
    My contract is an ERC721, (buy-sell). There is the token owner, the bidder and the contract administrator.
    Having this scenario, should I inherit from AccessControlUpgradeable or can I just use OwnableUpgradeable?

    Thank you very much

    Ânderson Q.
    Hey, there! 👋🏽 I work at the AKASHA Foundation, and I'd like to invite you to participate in a quick survey. We need feedback from developers to fine-tune our framework and the end-to-end development experience. We will use Zoom for chatting with you, and it wouldn't take more than 45 minutes. So, if you're a developer working on Ethereum-related projects and you're willing to help, please sign up using the following link: https://calendly.com/akasha-eth/dev-user-research We appreciate the help! 🙏🏽🤗
    Hi, I would like to deploy an NFT contract on Ganache, but I am not sure if there are some tools that allow me to visualise my minted NFT. I usually deploy them on ropsten and use opensea the visualise them.
    Anyone have documentation on smart contract syntax?
    Currently contracts are accepting ETH as the native payment for contracts.
    Is there a way / example to force payments in USDT or any other ERC20 tokens instead?
    Hi, I would like to know where I can find the kucoin and gateio exchange factory address. let me know if anyone knows.
    Thank you
    Hi, Is there anyone that knows what this code error means? Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }
    Ben Scherrey

    Currently contracts are accepting ETH as the native payment for contracts.
    Is there a way / example to force payments in USDT or any other ERC20 tokens instead?

    You'd need whatever method is checking the payment value to also check the contract address of the payment token. You can then restrict it to only the address of the particular token you want to support.

    Wang JunDong
    i need blockchain project