//pragma solidity ^0.7.0; contract BlockInfo { uint public ethPrice; bytes32 public blockHash; bytes32 public parentHash; bytes32 public sha3Uncles; uint public nonce; constructor(uint _ethPrice, bytes32 _blockHash, bytes32 _parentHash, bytes32 _sha3Uncles, uint _nonce) { ethPrice = _ethPrice; blockHash = _blockHash; parentHash = _parentHash; sha3Uncles = _sha3Uncles; nonce = _nonce; } function getBlockInfo() public view returns (uint, bytes32, bytes32, bytes32, uint) { return (ethPrice, blockHash, parentHash, sha3Uncles, nonce); } }Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.7.0; contract SimpleStore { function set(uint _value) public { value = _value; } function get() public constant returns (uint) { return value; } uint value; } // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } } } ) } ) ) } ) ) } ) }
0.7.0