pragma solidity 0.8.0;
contract payableTest{
// function pay() payable public{
// }
function getBalance() public returns(uint){
return address(this).balance;
}
function getThis() view public returns(address){
return address(this);
}
//0x5B38Da6a701c568545dCfcB03FcB875f56beddC4
//0xddaAd340b0f1Ef65169Ae5E41A8b10776a75482d
//0xddaAd340b0f1Ef65169Ae5E41A8b10776a75482d--getthis
//
function getrandomBalance() view public returns(uint){
address account = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
return account.balance;
}
//transfer转移资金
function transfer1() payable public{
address account = 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db;
payable(account).transfer(msg.value);
}
//function transfer2() payable public{
// this.transfer(msg.value);
//}
//function () payable public{
//}
}
17.Solidity-payable
最新推荐文章于 2023-04-14 10:09:55 发布