8000 feat: prettier by 0xhank · Pull Request #45 · dfdao/eth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: prettier #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: devcon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions contracts/DFArenaInitialize.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {WithStorage} from "./libraries/LibStorage.sol";
import {WithArenaStorage} from "./libraries/LibArenaStorage.sol";
import {LibGameUtils} from "./libraries/LibGameUtils.sol";

// Contract imports
// Contract imports
import {DFWhitelistFacet} from "./facets/DFWhitelistFacet.sol";

// Type imports
Expand All @@ -47,10 +47,7 @@ contract DFArenaInitialize is WithStorage, WithArenaStorage {

// You can add parameters to this function in order to pass in
// data to set initialize state variables
function init(
InitArgs calldata initArgs,
AuxiliaryArgs calldata auxArgs
) external {
function init(InitArgs calldata initArgs, AuxiliaryArgs calldata auxArgs) external {
// adding ERC165 data
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
ds.supportedInterfaces[type(IERC165).interfaceId] = true;
Expand Down Expand Up @@ -80,8 +77,10 @@ contract DFArenaInitialize is WithStorage, WithArenaStorage {
/*
Transferring ownership here is necessary because contract owner needs to do it.
*/
if(initArgs.NO_ADMIN) {
(bool success, bytes memory returndata) = address(this).delegatecall(abi.encodeWithSignature("transferOwnership(address)", address(0)));
if (initArgs.NO_ADMIN) {
(bool success, bytes memory returndata) = address(this).delegatecall(
abi.encodeWithSignature("transferOwnership(address)", address(0))
);
require(success, "transfer ownership did not succeed");
}
}
Expand Down
14 changes: 3 additions & 11 deletions contracts/DFInitialize.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ import {IERC173} from "./vendor/interfaces/IERC173.sol";
import {IERC165} from "@solidstate/contracts/introspection/IERC165.sol";
import {IERC721} from "@solidstate/contracts/token/ERC721/IERC721.sol";
import {IERC721Metadata} from "@solidstate/contracts/token/ERC721/metadata/IERC721Metadata.sol";
import {
IERC721Enumerable
} from "@solidstate/contracts/token/ERC721/enumerable/IERC721Enumerable.sol";
import {IERC721Enumerable} from "@solidstate/contracts/token/ERC721/enumerable/IERC721Enumerable.sol";

// Inherited storage
import {
ERC721MetadataStorage
} from "@solidstate/contracts/token/ERC721/metadata/ERC721MetadataStorage.sol";
import {ERC721MetadataStorage} from "@solidstate/contracts/token/ERC721/metadata/ERC721MetadataStorage.sol";

// Library imports
import {LibDiamond} from "./vendor/libraries/LibDiamond.sol";
Expand Down Expand Up @@ -115,16 +111,12 @@ struct AuxiliaryArgs {
address[] allowedAddresses;
}


contract DFInitialize is WithStorage {
using ERC721MetadataStorage for ERC721MetadataStorage.Layout;

// You can add parameters to this function in order to pass in
// data to set initialize state variables
function init(
InitArgs memory initArgs,
AuxiliaryArgs memory auxArgs
) external {
function init(InitArgs memory initArgs, AuxiliaryArgs memory auxArgs) external {
// adding ERC165 data
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
ds.supportedInterfaces[type(IERC165).interfaceId] = true;
Expand Down
52 changes: 39 additions & 13 deletions contracts/DFTypes.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

enum PlanetType {PLANET, SILVER_MINE, RUINS, TRADING_POST, SILVER_BANK}
enum PlanetEventType {ARRIVAL}
enum SpaceType {NEBULA, SPACE, DEEP_SPACE, DEAD_SPACE}
enum UpgradeBranch {DEFENSE, RANGE, SPEED}
enum PlanetType {
PLANET,
SILVER_MINE,
RUINS,
TRADING_POST,
SILVER_BANK
}
enum PlanetEventType {
ARRIVAL
}
enum SpaceType {
NEBULA,
SPACE,
DEEP_SPACE,
DEAD_SPACE
}
enum UpgradeBranch {
DEFENSE,
RANGE,
SPEED
}

struct Player {
bool isInitialized;
Expand Down Expand Up @@ -88,7 +105,12 @@ struct PlanetEventMetadata {
uint256 timeAdded;
}

enum ArrivalType {Unknown, Normal, Photoid, Wormhole}
enum ArrivalType {
Unknown,
Normal,
Photoid,
Wormhole
}

struct DFPInitPlanetArgs {
uint256 location;
Expand Down Expand Up @@ -195,7 +217,14 @@ enum ArtifactType {
ShipTitan
}

enum ArtifactRarity {Unknown, Common, Rare, Epic, Legendary, Mythic}
enum ArtifactRarity {
Unknown,
Common,
Rare,
Epic,
Legendary,
Mythic
}

// for NFTs
struct Artifact {
Expand Down Expand Up @@ -287,7 +316,7 @@ enum Mod {
barbarianPercentage
}
// # Mothership, Whale, Crescent, Gear, Titan
struct Spaceships{
struct Spaceships {
bool mothership;
bool whale;
bool crescent;
Expand All @@ -296,13 +325,13 @@ struct Spaceships{
}

struct RevealProofArgs {
uint256[2] _a;
uint256[2] _a;
uint256[2][2] _b;
uint256[2] _c;
uint256[9] _input;
}

// Values that are critical for determining if a match is valid.
// Values that are critical for determining if a match is valid.
struct InitArgs {
bool START_PAUSED;
bool ADMIN_CAN_ADD_PLANETS;
Expand Down Expand Up @@ -373,17 +402,15 @@ struct InitArgs {
uint256 CLAIM_VICTORY_ENERGY_PERCENT;
// Manual Spawn
bool MANUAL_SPAWN;

uint256[8] MODIFIERS;
bool[5] SPACESHIPS;

bool RANDOM_ARTIFACTS;
bool NO_ADMIN;
ArenaCreateRevealPlanetArgs[] INIT_PLANETS;
bool CONFIRM_START;
uint256 TARGETS_REQUIRED_FOR_VICTORY;
bool BLOCK_MOVES;
bool BLOCK_CAPTURE;
bool BLOCK_CAPTURE;
bool TEAMS_ENABLED;
uint256 NUM_TEAMS;
bool RANKED;
Expand All @@ -395,4 +422,3 @@ struct AuxiliaryArgs {
string artifactBaseURI;
address[] allowedAddresses;
}

Loading
0