First of all, thank you for your support.
Is the first time I use TransparentUpgradeableProxy. There are three parameters involved in this.
- Address logic (This is the contract address of the business)
- Address admin (I understand)
- Bytes Memory Data
I’m not sure how to configure the data parameter.
** Environment **
IDE: Remix
OS: MacBook
OS Version: 10.15.7
Code File: @openzeppelin/contracts/proxy/Proxy.sol
Chain: Bsc
** Details **
I understand the composition of setting a function and args in data. The problems I want to solve are as follows:
- Address logic (this is the business contract address), this parameter understand correct?
- Bytes Memory Data
2.1 If there are multiple methods and parameters, how to configure them?
2.2 Is there a tool that can quickly calculate this parameter? - How can I verify that what I post is correct? I use Remix. I can only access the interface of Proxy.
** Code to reproduce **
contract TransparentUpgradeableProxy is UpgradeableProxy {
/ * *
* @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
* optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
* /
constructor(address _logic, address _admin, bytes memory _data) public payable UpgradeableProxy(_logic, _data) {
assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(_admin);
}
...
}