Index

Solidity

  1. types
  2. External
  3. Library
    1. self in Library
    2. using * for
    3. self example
  4. interfaces
  5. import
  6. msg.value
  7. Handling ether
  8. Erc20 token in contract
  9. assembly
  10. Enum
  11. memory, storage, calldata
  12. Array Pushing
  13. length in array
  14. Struct array
  15. mapping
  16. bytes and string
  17. uint to bytes32
  18. returns with name
  19. score voting
  20. Tests
    1. Async Tests
    2. Hooks

returns with name

pragma solidity >=0.4.22 <0.7.0;
pragma experimental ABIEncoderV2;


contract Avrit {
    
struct Dispute { 
        uint number;
        bool ruled; 
}

Dispute[] public disputes; 

function createDisputes(uint number, bool ruled) public {
    Dispute memory newdispute = Dispute({ruled: ruled, number: number});
    disputes.push(newdispute);
   
}
                                                    // This is the code
function DisplayDisputes() public view returns (Dispute[] memory mydispute) {
    mydispute = disputes;
}


}


images/814-1.png