pragma solidity 0.8.0;
contract addresstest{
address public account = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
//0x5B38Da6a701c568545dCfcB03FcB875f56beddC4 uint160
//0x5B38Da6a701c568545dCfcB03FcB875f56beddC4
//0xd9145CCE52D386f254917e481eB44e9943F39138 合约的地址
//地址
address account1 = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
address account2 = 0xD7ACd2a9FD159E69Bb102A1ca21C9a3e3A5F771B;//heyue
function changeIt1() view public returns(uint160){
return uint160(account);
//520786028573371803640530888255888666801131675076
}
function changeIt2() view public returns(address){
return address(520786028573371803640530888255888666801131675076);
}
//地址之间可以通过大小进行对比
function check1() view public returns(bool){
return account1 >= account2;
}
function check2() view public returns(bool){
return account1 > account2;
}
function check3() view public returns(bool){
return account1 <= account2;
}
function check4() view public returns(bool){
return account1 < account2;
}
}
16.Solidity-地址-address
最新推荐文章于 2024-08-16 23:45:34 发布