1
0
forked from mico/idle_moloch

Compare commits

..

No commits in common. "52558567272a27b93a970c894532131b0e53605d" and "a45d74ebb2f5d684c3b4fc0fe0c4e5ad373c653d" have entirely different histories.

8 changed files with 9 additions and 49 deletions

6
.gitmodules vendored
View File

@ -4,9 +4,3 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib\\openzeppelin-foundry-upgrades"]
path = lib\\openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "lib\\openzeppelin-contracts-upgradeable"]
path = lib\\openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable

View File

@ -2,9 +2,5 @@
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

@ -1 +0,0 @@
Subproject commit fa525310e45f91eb20a6d3baa2644be8e0adba31

@ -1 +0,0 @@
Subproject commit 16e0ae21e0e39049f619f2396fa28c57fad07368

View File

@ -1,2 +1 @@
@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/

View File

@ -3,26 +3,15 @@ pragma solidity ^0.8.13;
import {Script, console} from "forge-std/Script.sol";
import {RaidGeld} from "../src/RaidGeld.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
contract RaidGeldScript is Script {
RaidGeld public raidgeld;
function setUp() public {}
function run() public {
vm.startBroadcast();
// Deploy the upgradeable contract
address _proxyAddress = Upgrades.deployTransparentProxy(
"RaidGeld.sol",
msg.sender,
abi.encodeCall(RaidGeld.initialize, ())
);
// Get the implementation address
address implementationAddress = Upgrades.getImplementationAddress(
_proxyAddress
);
raidgeld = new RaidGeld();
vm.stopBroadcast();
}
}

View File

@ -1,13 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import {RaidGeldUtils} from "../src/RaidGeldUtils.sol";
import {Army, Player, Raider} from "../src/RaidGeldStructs.sol";
contract RaidGeld is Initializable, ERC20Upgradeable, OwnableUpgradeable {
contract RaidGeld is ERC20, Ownable {
uint256 public constant MANTISSA = 1e4;
uint256 public constant BUY_IN_AMOUNT = 0.00005 ether;
@ -22,10 +21,7 @@ contract RaidGeld is Initializable, ERC20Upgradeable, OwnableUpgradeable {
_;
}
function initialize() public initializer {
__ERC20_init("Raid Geld", "GELD");
__Ownable_init(msg.sender);
}
constructor() ERC20("Raid Geld", "GELD") Ownable(msg.sender) {}
// This effectively registers the user
function register() external payable {

View File

@ -2,14 +2,11 @@
pragma solidity ^0.8.13;
import {Test, console} from "forge-std/Test.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
import {RaidGeld, Army, Player} from "../src/RaidGeld.sol";
import "../src/RaidGeldUtils.sol";
contract raid_geldTest is Test {
RaidGeld public raid_geld;
address implementationAddress;
address payable proxyAddress;
address public player1;
address public player2;
address public owner;
@ -20,16 +17,7 @@ contract raid_geldTest is Test {
vm.deal(owner, 10 ether);
vm.deal(player1, 10 ether);
vm.prank(owner);
// Deploy the upgradeable contract
address _proxyAddress = Upgrades.deployTransparentProxy(
"RaidGeld.sol",
msg.sender,
abi.encodeCall(RaidGeld.initialize, ())
);
proxyAddress = payable(_proxyAddress);
raid_geld = RaidGeld(proxyAddress);
raid_geld = new RaidGeld();
}
function registerPlayer() private {