0%

solidity | this

合约中 this 的返回。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pragma solidity ^0.8.0;

contract airdrop{

function getThis() public view returns(address){
return address(this);
}

function getThis2() public view returns(address){
return test();
}

function test() public view returns(address){
return address(this);
}

}

部署完后,合约地址是

  • 0xd9145CCE52D386f254917e481eB44e9943F39138

执行上面的方法,全部返回

  • 0xd9145CCE52D386f254917e481eB44e9943F39138
请我喝杯咖啡吧~