Skip to content

Commit

Permalink
Merge pull request #92 from axieinfinity/implement-feature/forge-std/…
Browse files Browse the repository at this point in the history
…update-forge-std

feat(forge-std): implement `update-forge-std`
  • Loading branch information
TuDo1403 committed Feb 20, 2024
2 parents 0e80cc6 + dab3025 commit c2a1d17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/forge-std
8 changes: 4 additions & 4 deletions script/libraries/LibProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ library LibProxy {
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

function getProxyAdmin(address payable proxy, bool nullCheck) internal returns (address payable proxyAdmin) {
function getProxyAdmin(address payable proxy, bool nullCheck) internal view returns (address payable proxyAdmin) {
proxyAdmin = payable(address(uint160(uint256(vm.load(address(proxy), ADMIN_SLOT)))));
if (!nullCheck) return proxyAdmin;
require(
Expand All @@ -18,11 +18,11 @@ library LibProxy {
);
}

function getProxyAdmin(address payable proxy) internal returns (address payable proxyAdmin) {
function getProxyAdmin(address payable proxy) internal view returns (address payable proxyAdmin) {
proxyAdmin = getProxyAdmin({ proxy: proxy, nullCheck: true });
}

function getProxyImplementation(address payable proxy, bool nullCheck) internal returns (address payable impl) {
function getProxyImplementation(address payable proxy, bool nullCheck) internal view returns (address payable impl) {
impl = payable(address(uint160(uint256(vm.load(address(proxy), IMPLEMENTATION_SLOT)))));
if (!nullCheck) return impl;
require(
Expand All @@ -31,7 +31,7 @@ library LibProxy {
);
}

function getProxyImplementation(address payable proxy) internal returns (address payable impl) {
function getProxyImplementation(address payable proxy) internal view returns (address payable impl) {
impl = getProxyImplementation({ proxy: proxy, nullCheck: true });
}
}

0 comments on commit c2a1d17

Please sign in to comment.