Skip to content

Commit af95eb5

Browse files
committed
upgreadeble contracts name
1 parent 7df0aca commit af95eb5

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Repository Guidelines
22

33
## Project Structure & Module Organization
4-
- `src/` Solidity contracts (e.g., `LemonJet.sol`, `Vault.sol`); interfaces live in `src/interfaces/`.
4+
- `src/` Solidity contracts (e.g., `LemonJetUpgradeable.sol`, `VaultUpgradeable.sol`); interfaces live in `src/interfaces/`.
55
- `test/` Foundry tests (`*.t.sol`) and `test/mocks/` for mock contracts.
66
- `script/` Foundry scripts (`*.s.sol`) with helpers in `script/utils/`.
77
- `broadcast/` deployment artifacts per script/chain, `out/` build outputs, `cache/` local build cache.
@@ -18,7 +18,7 @@
1818
## Coding Style & Naming Conventions
1919
- Solidity version is 0.8.28 (`foundry.toml`); keep `pragma solidity ^0.8.28`.
2020
- Use 4-space indentation and let `forge fmt` normalize spacing/imports.
21-
- Contracts and files use PascalCase (`LemonJet.sol`), functions use camelCase.
21+
- Contracts and files use PascalCase (`LemonJetUpgradeable.sol`), functions use camelCase.
2222
- Tests are `*.t.sol` with `*Test` contracts; revert cases often use `test_RevertWhen_...`.
2323

2424
## Testing Guidelines

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ libs = ["lib"]
55
optimizer = true
66
optimizer_runs = 20_000
77
solc_version = "0.8.28"
8-
gas_reports = ["LemonJet"]
8+
gas_reports = ["LemonJetUpgradeable"]
99
ffi = true
1010
ast = true
1111
build_info = true

script/LemonJet.s.sol

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.13;
44
import {Script} from "forge-std/Script.sol";
55
import {console2} from "forge-std/console2.sol";
66
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
7-
import {LemonJet} from "../src/LemonJet.sol";
7+
import {LemonJetUpgradeable} from "../src/LemonJetUpgradeable.sol";
88
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
99

1010
contract LemonJetDeployScript is Script {
@@ -16,15 +16,16 @@ contract LemonJetDeployScript is Script {
1616

1717
vm.startBroadcast(deployerPrivateKey);
1818

19-
// Deploy a UUPS proxy with the LemonJet implementation
19+
// Deploy a UUPS proxy with the LemonJetUpgradeable implementation
2020
address proxy = Upgrades.deployUUPSProxy(
21-
"LemonJet.sol",
21+
"LemonJetUpgradeable.sol:LemonJetUpgradeable",
2222
abi.encodeCall(
23-
LemonJet.initialize, (vrfWrapper, reserveFund, IERC20(vaultToken), "LemonJet Vault", "LJUSDC")
23+
LemonJetUpgradeable.initialize,
24+
(vrfWrapper, reserveFund, IERC20(vaultToken), "LemonJet Vault", "LJUSDC")
2425
)
2526
);
2627

27-
console2.log("LemonJet UUPS proxy deployed at:", proxy);
28+
console2.log("LemonJetUpgradeable UUPS proxy deployed at:", proxy);
2829

2930
vm.stopBroadcast();
3031
}

script/Play.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.28;
33

44
import {Script} from "forge-std/Script.sol";
55
import {console2} from "forge-std/console2.sol";
6-
import {LemonJet} from "../src/LemonJet.sol";
6+
import {LemonJetUpgradeable} from "../src/LemonJetUpgradeable.sol";
77
import {LemonJetToken} from "../test/mocks/LemonJetToken.sol";
88

99
contract PlayLemonJetScript is Script {
@@ -14,7 +14,7 @@ contract PlayLemonJetScript is Script {
1414
//
1515
// (bool success,) = ljtGame.call{value: 1000000000000000, gas: 500000}(
1616
// abi.encodeWithSelector(
17-
// LemonJet.play.selector, 111111, 200, address(0xBa0d95449B5E901CFb938fa6b6601281cEf679a4)
17+
// LemonJetUpgradeable.play.selector, 111111, 200, address(0xBa0d95449B5E901CFb938fa6b6601281cEf679a4)
1818
// )
1919
// );
2020
// require(success, "Failed to send Ether");
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
66
import {VRFV2PlusWrapperConsumerBaseUpgradeable} from "./VRFV2PlusWrapperConsumerBase.sol";
77
import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol";
88
import {ILemonJet} from "./interfaces/ILemonJet.sol";
9-
import {Vault} from "./Vault.sol";
9+
import {VaultUpgradeable} from "./VaultUpgradeable.sol";
1010
import {Referral} from "./Referral.sol";
1111
import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol";
1212
import {UUPSUpgradeable} from "openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
1313

14-
contract LemonJet is
14+
contract LemonJetUpgradeable is
1515
ILemonJet,
1616
Referral,
17-
Vault,
17+
VaultUpgradeable,
1818
VRFV2PlusWrapperConsumerBaseUpgradeable,
1919
OwnableUpgradeable,
2020
UUPSUpgradeable
@@ -54,7 +54,7 @@ contract LemonJet is
5454
string memory _symbol
5555
) public initializer {
5656
VRFV2PlusWrapperConsumerBaseUpgradeable.initialize(wrapperAddress);
57-
Vault.initialize(_asset, _reserveFund, _name, _symbol);
57+
VaultUpgradeable.initialize(_asset, _reserveFund, _name, _symbol);
5858
__Ownable_init(msg.sender);
5959
}
6060

@@ -127,7 +127,7 @@ contract LemonJet is
127127
// check if a player has won
128128
if (randomNumber <= gameThreshold) {
129129
/**
130-
* @dev See {Vault-_payoutWin}.
130+
* @dev See {VaultUpgradeable-_payoutWin}.
131131
*/
132132
_payoutWin(player, payout);
133133
} else {

src/Vault.sol renamed to src/VaultUpgradeable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
77
import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
88
import {IERC4626} from "openzeppelin-contracts/contracts/interfaces/IERC4626.sol";
99

10-
contract Vault is IVault, ERC4626FeesUpgradeable {
10+
contract VaultUpgradeable is IVault, ERC4626FeesUpgradeable {
1111
uint256 private constant _reserveFundFeeBasisPoints = 10; // 0.1%
1212
address public reserveFund;
1313

test/LemonJet.t.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.28;
33

44
import {Test} from "forge-std/Test.sol";
5-
import {LemonJet} from "../src/LemonJet.sol";
5+
import {LemonJetUpgradeable} from "../src/LemonJetUpgradeable.sol";
66
import {HelperContract} from "./HelperContract.sol";
77
import {UnsafeUpgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
88
import {ILemonJet} from "../src/interfaces/ILemonJet.sol";
@@ -19,7 +19,7 @@ contract LemonJetTest is Test, HelperContract {
1919
address constant newReferralAddress = address(6);
2020
ERC20Mock ljtToken;
2121
ERC20Mock usdcToken;
22-
LemonJet ljtGame;
22+
LemonJetUpgradeable ljtGame;
2323

2424
MockLinkToken private s_linkToken;
2525

@@ -31,18 +31,18 @@ contract LemonJetTest is Test, HelperContract {
3131
ljtToken = new ERC20Mock();
3232

3333
// Deploy implementation directly for coverage testing
34-
address implementation = address(new LemonJet());
34+
address implementation = address(new LemonJetUpgradeable());
3535

3636
// Deploy UUPS proxy using UnsafeUpgrades (recommended for coverage tests)
3737
address proxy = UnsafeUpgrades.deployUUPSProxy(
3838
implementation,
3939
abi.encodeCall(
40-
LemonJet.initialize,
40+
LemonJetUpgradeable.initialize,
4141
(address(s_wrapper), reserveFund, IERC20(address(ljtToken)), "Vault LemonJet", "VLJT")
4242
)
4343
);
4444

45-
ljtGame = LemonJet(proxy);
45+
ljtGame = LemonJetUpgradeable(proxy);
4646

4747
ljtToken.mint(address(ljtGame), 500 ether);
4848
ljtToken.mint(player, 500 ether);

test/Vault.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ pragma solidity ^0.8.28;
44
import {Test} from "forge-std/Test.sol";
55
import {console2} from "forge-std/console2.sol";
66
import {ERC20Mock} from "openzeppelin-contracts/contracts/mocks/token/ERC20Mock.sol";
7-
import {Vault} from "../src/Vault.sol";
7+
import {VaultUpgradeable} from "../src/VaultUpgradeable.sol";
88
import {VaultHarness} from "./mocks/VaultHarness.sol";
99
import {HelperContract} from "./HelperContract.sol";
1010
import {UnsafeUpgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
1111
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
1212

1313
contract VaultTest is Test, HelperContract {
1414
ERC20Mock asset;
15-
Vault vault;
15+
VaultUpgradeable vault;
1616

1717
function setUp() public {
1818
asset = new ERC20Mock();
@@ -26,7 +26,7 @@ contract VaultTest is Test, HelperContract {
2626
abi.encodeCall(VaultHarness.initialize, (IERC20(address(asset)), reserveFund, "LemonJet Vault", "VLJT"))
2727
);
2828

29-
vault = Vault(proxy);
29+
vault = VaultUpgradeable(proxy);
3030

3131
asset.mint(player, 10 ether);
3232
vm.startPrank(player);

test/mocks/VaultHarness.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity 0.8.28;
33

4-
import {Vault} from "../../src/Vault.sol";
4+
import {VaultUpgradeable} from "../../src/VaultUpgradeable.sol";
55
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
66

7-
/// @dev Test harness for Vault that provides an initializer entry point
8-
contract VaultHarness is Vault {
7+
/// @dev Test harness for VaultUpgradeable that provides an initializer entry point
8+
contract VaultHarness is VaultUpgradeable {
99
function initialize(IERC20 _asset, address _reserveFund, string memory _name, string memory _symbol)
1010
public
1111
override

0 commit comments

Comments
 (0)