Skip to content

Commit 77d317f

Browse files
committed
chore: rename to proxy loader
1 parent 3d40036 commit 77d317f

File tree

3 files changed

+13
-77
lines changed

3 files changed

+13
-77
lines changed

README.md

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1 @@
1-
## Foundry
2-
3-
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
4-
5-
Foundry consists of:
6-
7-
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
8-
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
9-
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
10-
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
11-
12-
## Documentation
13-
14-
https://book.getfoundry.sh/
15-
16-
## Usage
17-
18-
### Build
19-
20-
```shell
21-
$ forge build
22-
```
23-
24-
### Test
25-
26-
```shell
27-
$ forge test
28-
```
29-
30-
### Format
31-
32-
```shell
33-
$ forge fmt
34-
```
35-
36-
### Gas Snapshots
37-
38-
```shell
39-
$ forge snapshot
40-
```
41-
42-
### Anvil
43-
44-
```shell
45-
$ anvil
46-
```
47-
48-
### Deploy
49-
50-
```shell
51-
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
52-
```
53-
54-
### Cast
55-
56-
```shell
57-
$ cast <subcommand>
58-
```
59-
60-
### Help
61-
62-
```shell
63-
$ forge --help
64-
$ anvil --help
65-
$ cast --help
66-
```
1+
## Alchemy Proxy Forwarder Contract

src/AlchemyProxyRegistry.sol renamed to src/AlchemyProxyLoader.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ pragma solidity ^0.8.13;
44
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
55

66
/**
7-
* @title AlchemyProxyRegistry
7+
* @title AlchemyProxyLoader
88
* @author Alchemy
9-
* @notice A registry for getting the same address for proxies regardless of their implementation
9+
* @notice A loader to getting the same address for proxies regardless of their implementation
10+
* @dev To use, deploy a proxy pointing to this, then call upgradeToAndCall to the implementation
1011
*/
11-
contract AlchemyProxyRegistry is UUPSUpgradeable {
12+
contract AlchemyProxyLoader is UUPSUpgradeable {
1213
address public immutable deployer;
1314

1415
constructor(address _deployer) {

test/AlchemyProxyRegistry.t.sol renamed to test/AlchemyProxyLoader.t.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
pragma solidity ^0.8.13;
33

44
import {Test, console} from "forge-std/Test.sol";
5-
import {AlchemyProxyRegistry} from "../src/AlchemyProxyRegistry.sol";
5+
import {AlchemyProxyLoader} from "../src/AlchemyProxyLoader.sol";
66
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
77

8-
contract AlchemyProxyRegistryTest is Test {
9-
AlchemyProxyRegistry public proxyRegistry;
8+
contract AlchemyProxyLoaderTest is Test {
9+
AlchemyProxyLoader public proxyRegistry;
1010
bytes32 internal immutable _PROXY_IMPL_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
1111

1212
function setUp() public {
13-
proxyRegistry = new AlchemyProxyRegistry(address(this));
13+
proxyRegistry = new AlchemyProxyLoader(address(this));
1414
}
1515

1616
function test_deploys() public {
@@ -20,10 +20,10 @@ contract AlchemyProxyRegistryTest is Test {
2020
address proxy = address(new ERC1967Proxy(address(proxyRegistry), ""));
2121

2222
// instance of implementation to test upgradeTo
23-
address toUpgradeTo = address(new AlchemyProxyRegistry(address(this)));
23+
address toUpgradeTo = address(new AlchemyProxyLoader(address(this)));
2424

2525
assertEq(_getImplementation(proxy), address(proxyRegistry));
26-
AlchemyProxyRegistry(proxy).upgradeToAndCall(toUpgradeTo, "");
26+
AlchemyProxyLoader(proxy).upgradeToAndCall(toUpgradeTo, "");
2727

2828
// check that implementation is now the new implementation
2929
assertEq(_getImplementation(proxy), address(toUpgradeTo));
@@ -36,12 +36,12 @@ contract AlchemyProxyRegistryTest is Test {
3636
address proxy = address(new ERC1967Proxy(address(proxyRegistry), ""));
3737

3838
// instance of implementation to test upgradeTo
39-
address toUpgradeTo = address(new AlchemyProxyRegistry(address(this)));
39+
address toUpgradeTo = address(new AlchemyProxyLoader(address(this)));
4040

4141
assertEq(_getImplementation(proxy), address(proxyRegistry));
4242
vm.startPrank(address(1));
4343
vm.expectRevert("Only deployer can upgrade");
44-
AlchemyProxyRegistry(proxy).upgradeToAndCall(toUpgradeTo, "");
44+
AlchemyProxyLoader(proxy).upgradeToAndCall(toUpgradeTo, "");
4545

4646
// check that implementation is still the old implementation
4747
assertEq(_getImplementation(proxy), address(proxyRegistry));

0 commit comments

Comments
 (0)