solidity全局变量01

solidity全局变量01_第1张图片

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.4.0;
//
contract grobaltest {
function getgrobal1() public view returns(address){
return msg.sender;
}
function getgrobal2() public view returns(uint){
return block.difficulty;
}
function getgrobal3() public view returns(uint){
return block.number;
}
function getgrobal4() public view returns(uint){
return block.gaslimit;
}
function getgrobal5() public view returns(uint){
return block.timestamp;
}
function getgrobal6() public view returns(bytes){
return msg.data;
}
function getgrobal7() public view returns(uint){
return msg.gas;
}
function getgrobal8() public view returns(uint){
return msg.value;
}
function getgrobal9() public view returns(uint){
return tx.gasprice;
}
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.4.0;
//
contract grobaltest {
    function getgrobal1() public view returns(address){
        return msg.sender;
    }
    function getgrobal2() public view returns(uint){
        return block.difficulty;
    }    
    function getgrobal3() public view returns(uint){
        return block.number;
    }    
    function getgrobal4() public view returns(uint){
        return block.gaslimit;
    }    
    function getgrobal5() public view returns(uint){
        return block.timestamp;
    }  
    function getgrobal6() public view returns(bytes){
        return msg.data;
    }      
    function getgrobal7() public view returns(uint){
        return msg.gas;
    }      
    function getgrobal8() public view returns(uint){
        return msg.value;
    }      
    function getgrobal9() public view returns(uint){
        return tx.gasprice;
    }  
}

你可能感兴趣的:(Solidity,rust,区块链)