🦊6 关键字
关键字
new
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract A {
uint public num;
constructor (uint n){
num = n;
}
function getOwner() public view returns(address){
return msg.sender;
}
}
contract B {
address public addr;
A a = new A(10);
constructor(){
addr = a.getOwner();
}
}delete
修饰符
关键字
使用对象
作用
合约相关
Last updated