编译器
0.8.20+commit.a1b79de6
文件 1 的 9:AccessControl.sol
pragma solidity ^0.8.0;
import "third_party/open_zeppelin/utils/Strings.sol";
library AccessControl {
event RoleAdminChanged(
bytes32 indexed role,
bytes32 indexed previousAdminRole,
bytes32 indexed newAdminRole
);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
function _msgSender() internal view returns (address) {
return msg.sender;
}
function _msgData() internal pure returns (bytes calldata) {
return msg.data;
}
bytes32 constant rolesSlot = 0x53e43b954ba190a7e49386f1f78b01dcd9f628db23f432fa029a7dfd6d98e8fb;
function _roles() private pure returns (mapping(bytes32 => RoleData) storage roles) {
assembly {
roles.slot := rolesSlot
}
}
bytes32 constant DEFAULT_ADMIN_ROLE = 0x00;
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function hasRole(bytes32 role, address account) internal view returns (bool) {
return _roles()[role].members[account];
}
function _checkRole(bytes32 role) internal view {
_checkRole(role, _msgSender());
}
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
function getRoleAdmin(bytes32 role) internal view returns (bytes32) {
return _roles()[role].adminRole;
}
function grantRole(bytes32 role, address account) internal onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) internal onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) internal {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles()[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal {
if (!hasRole(role, account)) {
_roles()[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) internal {
if (hasRole(role, account)) {
_roles()[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
文件 2 的 9:Addresses.sol
pragma solidity ^0.8.0;
library Addresses {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function performEthTransfer(address recipient, uint256 amount) internal {
if (amount == 0) return;
(bool success, ) = recipient.call{value: amount}("");
require(success, "ETH_TRANSFER_FAILED");
}
function safeTokenContractCall(address tokenAddress, bytes memory callData) internal {
require(isContract(tokenAddress), "BAD_TOKEN_ADDRESS");
(bool success, bytes memory returndata) = tokenAddress.call(callData);
require(success, string(returndata));
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "TOKEN_OPERATION_FAILED");
}
}
}
文件 3 的 9:NamedStorage.sol
pragma solidity ^0.8.0;
library NamedStorage {
function bytes32ToBoolMapping(string memory tag_)
internal
pure
returns (mapping(bytes32 => bool) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function bytes32ToUint256Mapping(string memory tag_)
internal
pure
returns (mapping(bytes32 => uint256) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function addressToUint256Mapping(string memory tag_)
internal
pure
returns (mapping(address => uint256) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function bytes32ToAddressMapping(string memory tag_)
internal
pure
returns (mapping(bytes32 => address) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function uintToAddressMapping(string memory tag_)
internal
pure
returns (mapping(uint256 => address) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function addressToAddressMapping(string memory tag_)
internal
pure
returns (mapping(address => address) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function addressToAddressListMapping(string memory tag_)
internal
pure
returns (mapping(address => address[]) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function addressToBoolMapping(string memory tag_)
internal
pure
returns (mapping(address => bool) storage randomVariable)
{
bytes32 location = keccak256(abi.encodePacked(tag_));
assembly {
randomVariable.slot := location
}
}
function getUintValue(string memory tag_) internal view returns (uint256 retVal) {
bytes32 slot = keccak256(abi.encodePacked(tag_));
assembly {
retVal := sload(slot)
}
}
function setUintValue(string memory tag_, uint256 value) internal {
bytes32 slot = keccak256(abi.encodePacked(tag_));
assembly {
sstore(slot, value)
}
}
function setUintValueOnce(string memory tag_, uint256 value) internal {
require(getUintValue(tag_) == 0, "ALREADY_SET");
setUintValue(tag_, value);
}
function getAddressValue(string memory tag_) internal view returns (address retVal) {
bytes32 slot = keccak256(abi.encodePacked(tag_));
assembly {
retVal := sload(slot)
}
}
function setAddressValue(string memory tag_, address value) internal {
bytes32 slot = keccak256(abi.encodePacked(tag_));
assembly {
sstore(slot, value)
}
}
function setAddressValueOnce(string memory tag_, address value) internal {
require(getAddressValue(tag_) == address(0x0), "ALREADY_SET");
setAddressValue(tag_, value);
}
function getBoolValue(string memory tag_) internal view returns (bool retVal) {
bytes32 slot = keccak256(abi.encodePacked(tag_));
assembly {
retVal := sload(slot)
}
}
function setBoolValue(string memory tag_, bool value) internal {
bytes32 slot = keccak256(abi.encodePacked(tag_));
assembly {
sstore(slot, value)
}
}
}
文件 4 的 9:Proxy.sol
pragma solidity ^0.8.20;
import "starkware/solidity/upgrade/ProxyStorage.sol";
import "starkware/solidity/upgrade/StorageSlots.sol";
import "starkware/solidity/components/Roles.sol";
import "starkware/solidity/libraries/Addresses.sol";
contract Proxy is ProxyStorage, StorageSlots, Roles {
event ImplementationUpgraded(address indexed implementation, bytes initializer);
event ImplementationAdded(address indexed implementation, bytes initializer, bool finalize);
event ImplementationRemoved(address indexed implementation, bytes initializer, bool finalize);
event FinalizedImplementation(address indexed implementation);
using Addresses for address;
uint256 public constant MAX_UPGRADE_DELAY = 180 days;
string public constant PROXY_VERSION = "5.0.0";
constructor(uint256 upgradeActivationDelay) Roles(false) {
setUpgradeActivationDelay(upgradeActivationDelay);
setEnableWindowDuration(14 days);
}
function setUpgradeActivationDelay(uint256 delayInSeconds) private {
bytes32 slot = UPGRADE_DELAY_SLOT;
assembly {
sstore(slot, delayInSeconds)
}
}
function getUpgradeActivationDelay() public view returns (uint256 delay) {
bytes32 slot = UPGRADE_DELAY_SLOT;
assembly {
delay := sload(slot)
}
delay = (delay < MAX_UPGRADE_DELAY) ? delay : MAX_UPGRADE_DELAY;
return delay;
}
function getEnableWindowDuration() public view returns (uint256 duration) {
bytes32 slot = ENABLE_WINDOW_DURATION_SLOT;
assembly {
duration := sload(slot)
}
}
function setEnableWindowDuration(uint256 durationInSeconds) private {
bytes32 slot = ENABLE_WINDOW_DURATION_SLOT;
assembly {
sstore(slot, durationInSeconds)
}
}
function implementation() public view returns (address _implementation) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
_implementation := sload(slot)
}
}
function implementationIsFrozen() private returns (bool) {
address _implementation = implementation();
if (_implementation == address(0x0)) {
return false;
}
(bool success, bytes memory returndata) = _implementation.delegatecall(
abi.encodeWithSignature("isFrozen()")
);
require(success, string(returndata));
return abi.decode(returndata, (bool));
}
function initialize(
bytes calldata
) external pure {
revert("CANNOT_CALL_INITIALIZE");
}
modifier notFinalized() {
require(isNotFinalized(), "IMPLEMENTATION_FINALIZED");
_;
}
modifier notFrozen() {
require(!implementationIsFrozen(), "STATE_IS_FROZEN");
_;
}
receive() external payable {
revert("CONTRACT_NOT_EXPECTED_TO_RECEIVE");
}
fallback() external payable {
address _implementation = implementation();
require(_implementation != address(0x0), "MISSING_IMPLEMENTATION");
assembly {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), _implementation, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch result
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
function setImplementation(address newImplementation) private {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
function isNotFinalized() public view returns (bool notFinal) {
bytes32 slot = FINALIZED_STATE_SLOT;
uint256 slotValue;
assembly {
slotValue := sload(slot)
}
notFinal = (slotValue == 0);
}
function setFinalizedFlag() private {
bytes32 slot = FINALIZED_STATE_SLOT;
assembly {
sstore(slot, 0x1)
}
}
function addImplementation(
address newImplementation,
bytes calldata data,
bool finalize
) external onlyUpgradeGovernor {
require(newImplementation.isContract(), "ADDRESS_NOT_CONTRACT");
bytes32 implVectorHash = keccak256(abi.encode(newImplementation, data, finalize));
uint256 activationTime = block.timestamp + getUpgradeActivationDelay();
uint256 lastActivationTime = activationTime + getEnableWindowDuration();
enabledTime()[implVectorHash] = activationTime;
expirationTime()[implVectorHash] = lastActivationTime;
emit ImplementationAdded(newImplementation, data, finalize);
}
function removeImplementation(
address removedImplementation,
bytes calldata data,
bool finalize
) external onlyUpgradeGovernor {
bytes32 implVectorHash = keccak256(abi.encode(removedImplementation, data, finalize));
uint256 activationTime = enabledTime()[implVectorHash];
require(activationTime > 0, "UNKNOWN_UPGRADE_INFORMATION");
delete enabledTime()[implVectorHash];
delete expirationTime()[implVectorHash];
emit ImplementationRemoved(removedImplementation, data, finalize);
}
function upgradeTo(
address newImplementation,
bytes calldata data,
bool finalize
) external payable onlyUpgradeGovernor notFinalized notFrozen {
bytes32 implVectorHash = keccak256(abi.encode(newImplementation, data, finalize));
uint256 activationTime = enabledTime()[implVectorHash];
uint256 lastActivationTime = expirationTime()[implVectorHash];
require(activationTime > 0, "UNKNOWN_UPGRADE_INFORMATION");
require(newImplementation.isContract(), "ADDRESS_NOT_CONTRACT");
require(
activationTime <= block.timestamp || implementation() == address(0x0),
"UPGRADE_NOT_ENABLED_YET"
);
require(lastActivationTime >= block.timestamp, "IMPLEMENTATION_EXPIRED");
setImplementation(newImplementation);
(bool success, bytes memory returndata) = newImplementation.delegatecall(
abi.encodeWithSelector(this.initialize.selector, data)
);
require(success, string(returndata));
(success, returndata) = newImplementation.delegatecall(
abi.encodeWithSignature("isFrozen()")
);
require(success, "CALL_TO_ISFROZEN_REVERTED");
require(!abi.decode(returndata, (bool)), "NEW_IMPLEMENTATION_FROZEN");
delete enabledTime()[implVectorHash];
delete expirationTime()[implVectorHash];
emit ImplementationUpgraded(newImplementation, data);
if (finalize) {
setFinalizedFlag();
emit FinalizedImplementation(newImplementation);
}
}
}
文件 5 的 9:ProxyStorage.sol
pragma solidity ^0.8.0;
import "starkware/solidity/libraries/NamedStorage.sol";
contract ProxyStorage {
string constant ENABLED_TIME_TAG = "PROXY_5_ENABLED_TIME";
string constant DISABLED_TIME_TAG = "PROXY_5_DISABLED_TIME";
string constant INTIALIZED_TAG = "PROXY_5_INITIALIZED";
function enabledTime() internal pure returns (mapping(bytes32 => uint256) storage) {
return NamedStorage.bytes32ToUint256Mapping(ENABLED_TIME_TAG);
}
function expirationTime() internal pure returns (mapping(bytes32 => uint256) storage) {
return NamedStorage.bytes32ToUint256Mapping(DISABLED_TIME_TAG);
}
function initialized() internal pure returns (mapping(bytes32 => bool) storage) {
return NamedStorage.bytes32ToBoolMapping(INTIALIZED_TAG);
}
}
文件 6 的 9:Roles.sol
pragma solidity ^0.8.0;
import "starkware/solidity/libraries/RolesLib.sol";
abstract contract Roles {
bool immutable fullyRenouncable;
constructor(bool renounceable) {
fullyRenouncable = renounceable;
RolesLib.initialize();
}
modifier onlyAppGovernor() {
require(isAppGovernor(AccessControl._msgSender()), "ONLY_APP_GOVERNOR");
_;
}
modifier onlyOperator() {
require(isOperator(AccessControl._msgSender()), "ONLY_OPERATOR");
_;
}
modifier onlySecurityAdmin() {
require(isSecurityAdmin(AccessControl._msgSender()), "ONLY_SECURITY_ADMIN");
_;
}
modifier onlySecurityAgent() {
require(isSecurityAgent(AccessControl._msgSender()), "ONLY_SECURITY_AGENT");
_;
}
modifier onlyTokenAdmin() {
require(isTokenAdmin(AccessControl._msgSender()), "ONLY_TOKEN_ADMIN");
_;
}
modifier onlyUpgradeGovernor() {
require(isUpgradeGovernor(AccessControl._msgSender()), "ONLY_UPGRADE_GOVERNOR");
_;
}
modifier notSelf(address account) {
require(account != AccessControl._msgSender(), "CANNOT_PERFORM_ON_SELF");
_;
}
function isAppGovernor(address account) public view returns (bool) {
return AccessControl.hasRole(APP_GOVERNOR, account);
}
function isAppRoleAdmin(address account) public view returns (bool) {
return AccessControl.hasRole(APP_ROLE_ADMIN, account);
}
function isGovernanceAdmin(address account) public view returns (bool) {
return AccessControl.hasRole(GOVERNANCE_ADMIN, account);
}
function isOperator(address account) public view returns (bool) {
return AccessControl.hasRole(OPERATOR, account);
}
function isSecurityAdmin(address account) public view returns (bool) {
return AccessControl.hasRole(SECURITY_ADMIN, account);
}
function isSecurityAgent(address account) public view returns (bool) {
return AccessControl.hasRole(SECURITY_AGENT, account);
}
function isTokenAdmin(address account) public view returns (bool) {
return AccessControl.hasRole(TOKEN_ADMIN, account);
}
function isUpgradeGovernor(address account) public view returns (bool) {
return AccessControl.hasRole(UPGRADE_GOVERNOR, account);
}
function registerAppGovernor(address account) external {
AccessControl.grantRole(APP_GOVERNOR, account);
}
function registerAppRoleAdmin(address account) external {
AccessControl.grantRole(APP_ROLE_ADMIN, account);
}
function registerGovernanceAdmin(address account) external {
AccessControl.grantRole(GOVERNANCE_ADMIN, account);
}
function registerOperator(address account) external {
AccessControl.grantRole(OPERATOR, account);
}
function registerSecurityAdmin(address account) external {
AccessControl.grantRole(SECURITY_ADMIN, account);
}
function registerSecurityAgent(address account) external {
AccessControl.grantRole(SECURITY_AGENT, account);
}
function registerTokenAdmin(address account) external {
AccessControl.grantRole(TOKEN_ADMIN, account);
}
function registerUpgradeGovernor(address account) external {
AccessControl.grantRole(UPGRADE_GOVERNOR, account);
}
function revokeAppGovernor(address account) external {
AccessControl.revokeRole(APP_GOVERNOR, account);
}
function revokeAppRoleAdmin(address account) external notSelf(account) {
AccessControl.revokeRole(APP_ROLE_ADMIN, account);
}
function revokeGovernanceAdmin(address account) external notSelf(account) {
AccessControl.revokeRole(GOVERNANCE_ADMIN, account);
}
function revokeOperator(address account) external {
AccessControl.revokeRole(OPERATOR, account);
}
function revokeSecurityAdmin(address account) external notSelf(account) {
AccessControl.revokeRole(SECURITY_ADMIN, account);
}
function revokeSecurityAgent(address account) external {
AccessControl.revokeRole(SECURITY_AGENT, account);
}
function revokeTokenAdmin(address account) external {
AccessControl.revokeRole(TOKEN_ADMIN, account);
}
function revokeUpgradeGovernor(address account) external {
AccessControl.revokeRole(UPGRADE_GOVERNOR, account);
}
function renounceRole(bytes32 role, address account) external {
if (role == GOVERNANCE_ADMIN && !fullyRenouncable) {
revert("CANNOT_RENOUNCE_GOVERNANCE_ADMIN");
}
AccessControl.renounceRole(role, account);
}
}
文件 7 的 9:RolesLib.sol
pragma solidity ^0.8.0;
import "starkware/solidity/libraries/AccessControl.sol";
bytes32 constant APP_GOVERNOR = bytes32(
uint256(0xd2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de06068)
);
bytes32 constant APP_ROLE_ADMIN = bytes32(
uint256(0x03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee99)
);
bytes32 constant GOVERNANCE_ADMIN = bytes32(
uint256(0x03711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846)
);
bytes32 constant OPERATOR = bytes32(
uint256(0x023edb77f7c8cc9e38e8afe78954f703aeeda7fffe014eeb6e56ea84e62f6da7)
);
bytes32 constant SECURITY_ADMIN = bytes32(
uint256(0x026bd110619d11cfdfc28e281df893bc24828e89177318e9dbd860cdaedeb6b3)
);
bytes32 constant SECURITY_AGENT = bytes32(
uint256(0x037693ba312785932d430dccf0f56ffedd0aa7c0f8b6da2cc4530c2717689b96)
);
bytes32 constant TOKEN_ADMIN = bytes32(
uint256(0x0128d63adbf6b09002c26caf55c47e2f26635807e3ef1b027218aa74c8d61a3e)
);
bytes32 constant UPGRADE_GOVERNOR = bytes32(
uint256(0x0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228)
);
library RolesLib {
function governanceRolesInitialized() internal view returns (bool) {
return AccessControl.getRoleAdmin(GOVERNANCE_ADMIN) != bytes32(0x00);
}
function securityRolesInitialized() internal view returns (bool) {
return AccessControl.getRoleAdmin(SECURITY_ADMIN) != bytes32(0x00);
}
function initialize() internal {
address provisional = AccessControl._msgSender();
initialize(provisional, provisional);
}
function initialize(address provisionalGovernor, address provisionalSecAdmin) internal {
if (governanceRolesInitialized()) {
require(
AccessControl.hasRole(GOVERNANCE_ADMIN, provisionalGovernor),
"ROLES_ALREADY_INITIALIZED"
);
} else {
initGovernanceRoles(provisionalGovernor);
}
if (securityRolesInitialized()) {
require(
AccessControl.hasRole(SECURITY_ADMIN, provisionalSecAdmin),
"SECURITY_ROLES_ALREADY_INITIALIZED"
);
} else {
initSecurityRoles(provisionalSecAdmin);
}
}
function initSecurityRoles(address provisionalSecAdmin) private {
AccessControl._setRoleAdmin(SECURITY_ADMIN, SECURITY_ADMIN);
AccessControl._setRoleAdmin(SECURITY_AGENT, SECURITY_ADMIN);
AccessControl._grantRole(SECURITY_ADMIN, provisionalSecAdmin);
}
function initGovernanceRoles(address provisionalGovernor) private {
AccessControl._grantRole(GOVERNANCE_ADMIN, provisionalGovernor);
AccessControl._setRoleAdmin(APP_GOVERNOR, APP_ROLE_ADMIN);
AccessControl._setRoleAdmin(APP_ROLE_ADMIN, GOVERNANCE_ADMIN);
AccessControl._setRoleAdmin(GOVERNANCE_ADMIN, GOVERNANCE_ADMIN);
AccessControl._setRoleAdmin(OPERATOR, APP_ROLE_ADMIN);
AccessControl._setRoleAdmin(TOKEN_ADMIN, APP_ROLE_ADMIN);
AccessControl._setRoleAdmin(UPGRADE_GOVERNOR, GOVERNANCE_ADMIN);
}
}
文件 8 的 9:StorageSlots.sol
pragma solidity ^0.8.0;
contract StorageSlots {
bytes32 internal constant IMPLEMENTATION_SLOT =
0x177667240aeeea7e35eabe3a35e18306f336219e1386f7710a6bf8783f761b24;
bytes32 internal constant CALL_PROXY_IMPL_SLOT =
0x7184681641399eb4ad2fdb92114857ee6ff239f94ad635a1779978947b8843be;
bytes32 internal constant FINALIZED_STATE_SLOT =
0x7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d2;
bytes32 public constant UPGRADE_DELAY_SLOT =
0xc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f;
bytes32 public constant ENABLE_WINDOW_DURATION_SLOT =
0xb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc40590738;
}
文件 9 的 9:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
{
"compilationTarget": {
"starkware/solidity/upgrade/Proxy.sol": "Proxy"
},
"evmVersion": "shanghai",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"uint256","name":"upgradeActivationDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"FinalizedImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bytes","name":"initializer","type":"bytes"},{"indexed":false,"internalType":"bool","name":"finalize","type":"bool"}],"name":"ImplementationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bytes","name":"initializer","type":"bytes"},{"indexed":false,"internalType":"bool","name":"finalize","type":"bool"}],"name":"ImplementationRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bytes","name":"initializer","type":"bytes"}],"name":"ImplementationUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ENABLE_WINDOW_DURATION_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UPGRADE_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROXY_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_DELAY_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"finalize","type":"bool"}],"name":"addImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getEnableWindowDuration","outputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUpgradeActivationDelay","outputs":[{"internalType":"uint256","name":"delay","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"_implementation","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAppGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAppRoleAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isGovernanceAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isNotFinalized","outputs":[{"internalType":"bool","name":"notFinal","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isSecurityAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isSecurityAgent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isTokenAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isUpgradeGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerAppGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerAppRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerGovernanceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerSecurityAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerSecurityAgent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerTokenAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerUpgradeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"removedImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"finalize","type":"bool"}],"name":"removeImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeAppGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeAppRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeGovernanceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeSecurityAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeSecurityAgent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeTokenAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeUpgradeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"finalize","type":"bool"}],"name":"upgradeTo","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]