Skip to content

Commit

Permalink
replace deployProxyAndDsitribute -> deployProxyAndDistribute
Browse files Browse the repository at this point in the history
  • Loading branch information
banr1 committed Aug 18, 2023
1 parent 772e493 commit 9063a08
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ sequenceDiagram
rect rgba(0, 255, 0, 0.1)
alt Pattern 1: Distribute by organizer
Note over O: When organizer is active to end the contest
O->>PF: deployProxyAndDsitribute()
O->>PF: deployProxyAndDistribute()
else Pattern 2: Distribute by signature
Note over O: When organizer is active and wants to use meta tx
O ->> 1: send signature
1->>PF: deployProxyAndDsitributeBySignature()
1->>PF: deployProxyAndDistributeBySignature()
note over PF: signature validation is OK
else Pattern 3: Distribute by owner
Note over 1,W: Contest Expiration Phase
Note over O: When organizer is not active
Note over PF, D: And if contest is expired
1->>PF: deployProxyAndDsitributeByOwner()
1->>PF: deployProxyAndDistributeByOwner()
end
end
PF->>P: deploy proxy and calls distribute()
Expand All @@ -167,7 +167,7 @@ sequenceDiagram
Note over 1,W: Contest Expiration Phase
Note over P: Proxy is deployed and token is distributed
Note over P: If whitelisted tokens are sent by mistake
1->>PF: dsitributeByOwner()
1->>PF: distributeByOwner()
PF->>P: deploy proxy and calls distribute
P->>D: delegatecall distribute()
P-xRT: rescue erc20 token, send to rescue requestor
Expand Down
2 changes: 1 addition & 1 deletion src/ProxyFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ contract ProxyFactory is Ownable, EIP712 {
* @param data The prize distribution data
* @return The proxy address
*/
function deployProxyAndDsitribute(bytes32 contestId, address implementation, bytes calldata data)
function deployProxyAndDistribute(bytes32 contestId, address implementation, bytes calldata data)
public
returns (address)
{
Expand Down
4 changes: 2 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If the network is Anvil,

- `createData`, `createDataToSendToAdmin`, `setUpContestForJasonAndSentJpycv2Token`

- `deployProxyAndDsitribute`
- `deployProxyAndDistribute`

- "after the contest is set and then tokens has been sent to the proxy address"
- call it with wrong contest id, then revert
Expand Down Expand Up @@ -197,7 +197,7 @@ Fuzz testing is done with inputting random data into the function to check if th
- `setUpContestForJasonAndSentJpycv2Token`
- `createData`
- `createDataToSendToAdmin`
- `deployProxyAndDsitribute`
- `deployProxyAndDistribute`
- any contest id is not set, then revert
- any close time is not reached, then revert
- any implementation is not right, then revert
Expand Down
18 changes: 9 additions & 9 deletions test/fuzz/FuzzTestProxyFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
vm.warp(14 days);
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotRegistered.selector);
proxyFactory.deployProxyAndDsitribute(randomId, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId, address(distributor), data);
vm.stopPrank();
}

Expand Down Expand Up @@ -206,7 +206,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
// deploy proxy and distribute but expect revertting
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotClosed.selector);
proxyFactory.deployProxyAndDsitribute(someId, address(distributor), data);
proxyFactory.deployProxyAndDistribute(someId, address(distributor), data);
vm.stopPrank();
}

Expand All @@ -226,7 +226,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
// deploy proxy and distribute but expect revertting
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotRegistered.selector);
proxyFactory.deployProxyAndDsitribute(someId, address(randomImple), data);
proxyFactory.deployProxyAndDistribute(someId, address(randomImple), data);
vm.stopPrank();
}

Expand All @@ -242,7 +242,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
vm.warp(9 days);
vm.startPrank(randomUsr);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotRegistered.selector);
proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();
}

Expand All @@ -261,7 +261,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
bytes memory data = createData(randomNum_);
vm.warp(2 days);
vm.startPrank(organizer);
proxyFactory.deployProxyAndDsitribute(someId, address(distributor), data);
proxyFactory.deployProxyAndDistribute(someId, address(distributor), data);
vm.stopPrank();

// after
Expand Down Expand Up @@ -385,7 +385,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {

vm.warp(8.01 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(someId, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(someId, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -415,7 +415,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(SOMEID, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(SOMEID, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -447,7 +447,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(SOMEID, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(SOMEID, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -477,7 +477,7 @@ contract FuzzTestProxyFactory is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(2 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down
22 changes: 11 additions & 11 deletions test/integration/ProxyFactoryTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
vm.warp(14 days);
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotRegistered.selector);
proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();
}

Expand All @@ -281,7 +281,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
// deploy proxy and distribute
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotClosed.selector);
proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();
}

Expand All @@ -297,7 +297,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
vm.warp(9 days);
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotRegistered.selector);
proxyFactory.deployProxyAndDsitribute(randomId_, usdcAddress, data);
proxyFactory.deployProxyAndDistribute(randomId_, usdcAddress, data);
vm.stopPrank();
}

Expand All @@ -309,7 +309,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
vm.warp(9 days);
vm.startPrank(user1);
vm.expectRevert(ProxyFactory.ProxyFactory__ContestIsNotRegistered.selector);
proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();
}

Expand All @@ -328,7 +328,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
vm.warp(9 days);
vm.startPrank(organizer);
vm.expectRevert(ProxyFactory.ProxyFactory__DelegateCallFailed.selector);
proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();
}

Expand All @@ -345,7 +345,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {

vm.warp(9 days); // 9 days later
vm.startPrank(organizer);
proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// after
Expand Down Expand Up @@ -461,7 +461,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -490,7 +490,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -522,7 +522,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -551,7 +551,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down Expand Up @@ -580,7 +580,7 @@ contract ProxyFactoryTest is StdCheats, HelperContract {
// owner deploy and distribute
vm.warp(9 days);
vm.startPrank(organizer);
address proxyAddress = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
address proxyAddress = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

// sponsor send token to proxy by mistake
Expand Down
20 changes: 10 additions & 10 deletions test/integration/ProxyTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand All @@ -103,7 +103,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -134,7 +134,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -164,7 +164,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -194,7 +194,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -225,7 +225,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -254,7 +254,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -291,7 +291,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -332,7 +332,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down Expand Up @@ -376,7 +376,7 @@ contract ProxyTest is StdCheats, HelperContract {
bytes32 randomId_ = keccak256(abi.encode("James", "001"));
bytes memory data = createDataToDistributeJpycv2();
vm.startPrank(organizer);
deployedProxy = proxyFactory.deployProxyAndDsitribute(randomId_, address(distributor), data);
deployedProxy = proxyFactory.deployProxyAndDistribute(randomId_, address(distributor), data);
vm.stopPrank();

proxyWithDistributorLogic = Distributor(address(deployedProxy));
Expand Down

0 comments on commit 9063a08

Please sign in to comment.