Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    omarkw1
    @omarkw1_twitter
    The contracts are working on your platform but not mine. In short, what version of geth are you using?
    jun-henin
    @jun-henin
    Hi. does someone knows how to use 2 requires with "or" condition?
    should I use require (cond1 || cond2)?
    M'bark Erras
    @MbarkErras
    @wereITS you didn't specify if function should be public or private
    reyen
    @reyen_gitlab
    Hi everyone
    uint[] numbers;
    numbers.push(5);
    numbers.push(10);
    numbers.push(15);
    ERROR: Expected ';' but got '.'
    numbers.push(10);
    adam
    @IMVVVVVIP
    初来乍到多多指教
    Aman Bhargava
    @thenamesmickey
    can anyone explain me the voters solidity program
    realisation
    @realisation
    Can I have remote joint sessions?
    cs19mtech11020
    @cs19mtech11020
    How to call a function in contract from a different account(other than the account from which it is deployed) ?
    Monir Shaker
    @Moniroaf
    any one has good voting blockchain or rating blockchian code no solidity
    Justin
    @gititGoro
    Hi there, ethfiddle seems to have a bug currently: in the js console window, I'm getting CORS issues and when I compile I get
    "Uncaught (in promise) abort("Assertion failed: Cannot call unknown function compileJSON, make sure it is exported"). Build with -s ASSERTIONS=1 for more info."
    XDYB
    @XDYB
    compliling....
    Always show compliing....

    pragma solidity ^0.5.10;

    contract Persion {
    uint public age;
    }

    chungbacki
    @chungbacki
    ???
    Aveesh Shetty
    @Aveesh52
    Hey
    rooat
    @rooat
    Hi
    nishantbhutani
    @nishantbhutani

    pragma solidity^0.5.1;

    contract Courier {
    enum PackageStatus {
    inTransit,
    received,
    cancelled,
    arrived,
    booked
    }

    struct Package {
        uint id;
        uint weight;
        address sender;
        PackageStatus status;
        address receiver;
    }
    uint MULTIPLIER = 1;
    mapping (uint => address payable) public packageCourierId;
    mapping (address => uint) public pendingDeliveryCharge;
    Package[] private _packages;
    event PackageBooked(uint id, address sender, address receiver, uint weight);
    event PackagePicked(uint id, address courier, address sender, address receiver);
    event PackageArrived(uint id, address courier, address sender, address receiver);
    event PackageReceived(uint id, address courier, address sender, address receiver);
    event PackageCancelled(uint id, address courier, address sender, address receiver);
    
    function addPackage(uint  _weight, address payable receiver) public payable returns (uint){
        // Multipler is the numerical factor converting weight to delivery charge
        // we are keeping it as 1 for now.  Value must be equal to
        // weight*MULTIPLIER
    
        require(msg.value == _weight*MULTIPLIER, "Incorrect amount");
    
        uint id = _packages.length;
        _packages.push(Package({
            id: id,
            weight: _weight,
            sender: msg.sender,
            status: PackageStatus.booked,
            receiver: receiver
        }));
    
    
    
        emit PackageBooked(id, msg.sender, receiver, _weight);
        pendingDeliveryCharge[msg.sender] += msg.value;
    
        return id;
    
    }
    
    function pickPackage(uint _id) public{
        // courier calls this function to indicate that he has picked up the package
        Package storage currentPackage = _packages[_id];
        require(currentPackage.status == PackageStatus.booked, "Package is already dispatched");
        currentPackage.status = PackageStatus.inTransit;
    
        packageCourierId[_id] = msg.sender;
    
        emit PackagePicked(_id, msg.sender, currentPackage.sender, currentPackage.receiver);
    
    }
    
    function arrivedPackage(uint _id) public{
        // this function will be called by the courier
        // to indicate to the receiver that he has arrived at his address
    
        Package storage currentPackage = _packages[_id];
        require(currentPackage.status == PackageStatus.inTransit, "Package was not in transit for it to arrive");
        currentPackage.status = PackageStatus.arrived;
    
        emit PackageArrived(_id, msg.sender, currentPackage.sender, currentPackage.receiver);
    }
    
    function receivedPackage(uint _id) public payable returns (bool){
        // this function will be called by the receiver
        // to indicate that he has received the package
    
    
        Package storage currentPackage = _packages[_id];
    
        require(currentPackage.receiver == msg.sender && currentPackage.status == PackageStatus.arrived, "Package arrived at wrong receiver");
        currentPackage.status = PackageStatus.received;
        uint deliveryCharge = currentPackage.weight*MULTIPLIER;
        address payable courier = packageCourierId[_id];
    
    
        if(courier.send(deliveryCharge)){
            pendingDeliveryCharge[currentPackage.sender] -= deliveryCharge;
            emit PackageReceived(_id, courier, currentPackage.sender, currentPackage.receiver);
            return true;
        }
        else {
            return false;
        }
    }
    
    function cancelPackage(uint _id) public returns (bool){
        // only sender of package has the right to cancel Package
        // Funds will be given to courier only if he has picked up the package
        Package storage currentPackage = _packages[_id];
        require(msg.sender == currentPackage.sender && (currentPackage.status == PackageStatus.inTransit || currentPackage.status == PackageStatus.booked), "You do not have authorization to cancel package"
    i am not able to deploy this
    can anyone help
    Jon Doe
    @Scalamanga_gitlab
    Hi, can anyone shed some light on why remix IDE just disappeared in the past few hours?
    pymachado
    @pymachado
    hi
    any one Here_
    ?
    Hola tengo una duda respecto a la temporalidad en solidiy
    3 replies
    estoy haciendo una funcion para un smart contract que bloque a un usuario si ya paso su periodo de tiempo, que es igual a 30 dias..
    Jean Cvllr
    @CJ42
    Hello is there any way or workaround to resize memory arrays inside a function in Solidity?
    git-bia19
    @git-bia19
    hii
    Oort Cloud
    @firevenus
    hi
    Edson Tégila
    @tegila
    hi
    Felix H. C. Maduakor
    @fmaduakor
    Which compiler version are working with ethdiddle?
    0.7.1 is loading without any result
    Technologist
    @B_Blockchain_twitter
    Can you do things like check code instead of compile? More like make it a simulator?
    Blake Watkins
    @blkwtkns
    hi there, I just copied/pasted a contract into the fiddle, and I'm getting errors where emit is being used, anyone happen to know why this might be?
    shoot nvm this chat is dead
    blockchain developer
    @superronaldo
    Hi
    when I verify the contract on ethereum, how can I replace openzepplin...?
    OG NA$A
    @og_nasa_twitter
    ayo
    sup nerds
    is this supposed to be better than other ethereum uis
    compared to remix and others i mean like
    Anthony Huang
    @anthonyhuanggr_twitter
    how can i get the return value but not depoly ?
    CosmosLera
    @CosmosLera
    ufogreys
    @ufogreys
    hello
    i need help to create smartcotnract on tro
    tron blockchain
    Nam Trần Thanh
    @nam05062000_gitlab
    I need help:
    Give me a valid 1 about the constructor of the Voting post with
    Plssssss