Skip to content

Commit

Permalink
Fix eslint and prettier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Agupane committed Aug 16, 2023
1 parent 1a688f4 commit ca84a05
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 56 deletions.
40 changes: 20 additions & 20 deletions .openzeppelin/goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4768,31 +4768,31 @@
"label": "creators",
"offset": 0,
"slot": "407",
"type": "t_mapping(t_address,t_struct(Creator)7561_storage)",
"type": "t_mapping(t_address,t_struct(Creator)7596_storage)",
"contract": "TheBadgeStore",
"src": "src/contracts/thebadge/TheBadgeStore.sol:86"
},
{
"label": "badgeModelControllers",
"offset": 0,
"slot": "408",
"type": "t_mapping(t_string_memory_ptr,t_struct(BadgeModelController)7568_storage)",
"type": "t_mapping(t_string_memory_ptr,t_struct(BadgeModelController)7603_storage)",
"contract": "TheBadgeStore",
"src": "src/contracts/thebadge/TheBadgeStore.sol:87"
},
{
"label": "badgeModels",
"offset": 0,
"slot": "409",
"type": "t_mapping(t_uint256,t_struct(BadgeModel)7594_storage)",
"type": "t_mapping(t_uint256,t_struct(BadgeModel)7629_storage)",
"contract": "TheBadgeStore",
"src": "src/contracts/thebadge/TheBadgeStore.sol:88"
},
{
"label": "badges",
"offset": 0,
"slot": "410",
"type": "t_mapping(t_uint256,t_struct(Badge)7603_storage)",
"type": "t_mapping(t_uint256,t_struct(Badge)7638_storage)",
"contract": "TheBadgeStore",
"src": "src/contracts/thebadge/TheBadgeStore.sol:89"
},
Expand Down Expand Up @@ -4850,7 +4850,7 @@
"label": "mapping(address => mapping(address => bool))",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_struct(Creator)7561_storage)": {
"t_mapping(t_address,t_struct(Creator)7596_storage)": {
"label": "mapping(address => struct TheBadgeStore.Creator)",
"numberOfBytes": "32"
},
Expand All @@ -4862,7 +4862,7 @@
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_mapping(t_string_memory_ptr,t_struct(BadgeModelController)7568_storage)": {
"t_mapping(t_string_memory_ptr,t_struct(BadgeModelController)7603_storage)": {
"label": "mapping(string => struct TheBadgeStore.BadgeModelController)",
"numberOfBytes": "32"
},
Expand All @@ -4878,11 +4878,11 @@
"label": "mapping(uint256 => string)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_struct(Badge)7603_storage)": {
"t_mapping(t_uint256,t_struct(Badge)7638_storage)": {
"label": "mapping(uint256 => struct TheBadgeStore.Badge)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_struct(BadgeModel)7594_storage)": {
"t_mapping(t_uint256,t_struct(BadgeModel)7629_storage)": {
"label": "mapping(uint256 => struct TheBadgeStore.BadgeModel)",
"numberOfBytes": "32"
},
Expand All @@ -4894,7 +4894,7 @@
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Badge)7603_storage": {
"t_struct(Badge)7638_storage": {
"label": "struct TheBadgeStore.Badge",
"members": [
{
Expand Down Expand Up @@ -4924,7 +4924,7 @@
],
"numberOfBytes": "128"
},
"t_struct(BadgeModel)7594_storage": {
"t_struct(BadgeModel)7629_storage": {
"label": "struct TheBadgeStore.BadgeModel",
"members": [
{
Expand Down Expand Up @@ -4978,7 +4978,7 @@
],
"numberOfBytes": "256"
},
"t_struct(BadgeModelController)7568_storage": {
"t_struct(BadgeModelController)7603_storage": {
"label": "struct TheBadgeStore.BadgeModelController",
"members": [
{
Expand Down Expand Up @@ -5014,7 +5014,7 @@
],
"numberOfBytes": "32"
},
"t_struct(Creator)7561_storage": {
"t_struct(Creator)7596_storage": {
"label": "struct TheBadgeStore.Creator",
"members": [
{
Expand Down Expand Up @@ -5094,7 +5094,7 @@
"label": "theBadge",
"offset": 2,
"slot": "0",
"type": "t_contract(TheBadge)6925",
"type": "t_contract(TheBadge)6949",
"contract": "KlerosBadgeModelControllerStore",
"src": "src/contracts/badgeModelControllers/KleroBadgeModelControllerStore.sol:9"
},
Expand All @@ -5118,15 +5118,15 @@
"label": "klerosBadgeModel",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_uint256,t_struct(KlerosBadgeModel)4723_storage)",
"type": "t_mapping(t_uint256,t_struct(KlerosBadgeModel)4724_storage)",
"contract": "KlerosBadgeModelControllerStore",
"src": "src/contracts/badgeModelControllers/KleroBadgeModelControllerStore.sol:79"
},
{
"label": "klerosBadge",
"offset": 0,
"slot": "4",
"type": "t_mapping(t_uint256,t_struct(KlerosBadge)4732_storage)",
"type": "t_mapping(t_uint256,t_struct(KlerosBadge)4733_storage)",
"contract": "KlerosBadgeModelControllerStore",
"src": "src/contracts/badgeModelControllers/KleroBadgeModelControllerStore.sol:80"
},
Expand Down Expand Up @@ -5204,7 +5204,7 @@
"label": "contract IArbitrator",
"numberOfBytes": "20"
},
"t_contract(TheBadge)6925": {
"t_contract(TheBadge)6949": {
"label": "contract TheBadge",
"numberOfBytes": "20"
},
Expand All @@ -5216,15 +5216,15 @@
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_struct(KlerosBadge)4732_storage)": {
"t_mapping(t_uint256,t_struct(KlerosBadge)4733_storage)": {
"label": "mapping(uint256 => struct KlerosBadgeModelControllerStore.KlerosBadge)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_struct(KlerosBadgeModel)4723_storage)": {
"t_mapping(t_uint256,t_struct(KlerosBadgeModel)4724_storage)": {
"label": "mapping(uint256 => struct KlerosBadgeModelControllerStore.KlerosBadgeModel)",
"numberOfBytes": "32"
},
"t_struct(KlerosBadge)4732_storage": {
"t_struct(KlerosBadge)4733_storage": {
"label": "struct KlerosBadgeModelControllerStore.KlerosBadge",
"members": [
{
Expand Down Expand Up @@ -5254,7 +5254,7 @@
],
"numberOfBytes": "128"
},
"t_struct(KlerosBadgeModel)4723_storage": {
"t_struct(KlerosBadgeModel)4724_storage": {
"label": "struct KlerosBadgeModelControllerStore.KlerosBadgeModel",
"members": [
{
Expand Down
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
2 changes: 1 addition & 1 deletion script/01_deploy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as dotenv from "dotenv";
import hre, { run, upgrades } from "hardhat";
import hre, { upgrades } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";

dotenv.config();
Expand Down
7 changes: 3 additions & 4 deletions script/03_verify.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as dotenv from "dotenv";
import hre, { run, upgrades } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { run } from "hardhat";

dotenv.config();

Expand All @@ -12,7 +11,7 @@ if (!GOERLI_THE_BADGE_CONTRACT_ADDRESS || !GOERLI_KLEROS_BADGE_MODEL_CONTROLLER_
const theBadgeDeployedAddress = GOERLI_THE_BADGE_CONTRACT_ADDRESS;
const klerosBadgeModelControllerDeployedAddress = GOERLI_KLEROS_BADGE_MODEL_CONTROLLER_CONTRACT_ADDRESS;

async function main(hre: HardhatRuntimeEnvironment) {
async function main() {
console.log("Verifying TheBadge contract on Etherscan...");
await run(`verify:verify`, {
address: theBadgeDeployedAddress,
Expand All @@ -28,7 +27,7 @@ async function main(hre: HardhatRuntimeEnvironment) {

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main(hre).catch((error) => {
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.17;

import { IArbitrator } from "../../../lib/erc-792/contracts/IArbitrator.sol";
import { TheBadge } from "../thebadge/TheBadge.sol";
import "../../utils/CappedMath.sol";
import { CappedMath } from "../../utils/CappedMath.sol";

contract KlerosBadgeModelControllerStore {
TheBadge public theBadge;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ pragma solidity 0.8.17;
import { ILightGeneralizedTCR } from "../../interfaces/ILightGeneralizedTCR.sol";
import { ILightGTCRFactory } from "../../interfaces/ILightGTCRFactory.sol";

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "../../interfaces/IBadgeModelController.sol";
import "./KleroBadgeModelControllerStore.sol";
import "../thebadge/TheBadgeRoles.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { IBadgeModelController } from "../../interfaces/IBadgeModelController.sol";
import { TheBadgeRoles } from "../thebadge/TheBadgeRoles.sol";
import { KlerosBadgeModelControllerStore } from "./KleroBadgeModelControllerStore.sol";
import { CappedMath } from "../../utils/CappedMath.sol";
import { IArbitrator } from "../../../lib/erc-792/contracts/IArbitrator.sol";
import { TheBadge } from "../thebadge/TheBadge.sol";

contract KlerosBadgeModelController is
Initializable,
Expand Down
22 changes: 11 additions & 11 deletions src/contracts/thebadge/TheBadge.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";

import "./TheBadgeRoles.sol";
import "./TheBadgeStore.sol";
import "./TheBadgeModels.sol";
import "../../interfaces/ITheBadge.sol";
import { ERC1155Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import { ERC1155URIStorageUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol";
import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { CountersUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import { TheBadgeRoles } from "./TheBadgeRoles.sol";
import { TheBadgeModels } from "./TheBadgeModels.sol";
import { ITheBadge } from "../../interfaces/ITheBadge.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { IBadgeModelController } from "../../interfaces/IBadgeModelController.sol";

/// @custom:security-contact [email protected]
contract TheBadge is
Expand Down
10 changes: 6 additions & 4 deletions src/contracts/thebadge/TheBadgeModels.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ pragma solidity ^0.8.17;
* =========================
*/

import "../../interfaces/IBadgeModelController.sol";
import "./TheBadgeRoles.sol";
import "./TheBadgeStore.sol";
import "../../interfaces/ITheBadgeModels.sol";
import "../../interfaces/IBadgeModelController.sol" as BadgeModelController;
import { TheBadgeRoles } from "./TheBadgeRoles.sol";
import { TheBadgeStore } from "./TheBadgeStore.sol";
import { ITheBadgeModels } from "../../interfaces/ITheBadgeModels.sol";
import { CountersUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import { IBadgeModelController } from "../../interfaces/IBadgeModelController.sol";

contract TheBadgeModels is TheBadgeRoles, TheBadgeStore, ITheBadgeModels {
// Allows to use current() and increment() for badgeModelIds or badgeIds
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/thebadge/TheBadgeRoles.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

contract TheBadgeRoles is AccessControlUpgradeable {
bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/thebadge/TheBadgeStore.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "./TheBadgeRoles.sol";
import "../../interfaces/IBadgeModelController.sol";
import { CountersUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import { TheBadgeRoles } from "./TheBadgeRoles.sol";
import { IBadgeModelController } from "../../interfaces/IBadgeModelController.sol";

// TODO: Maybe we can use abstract classes to type the store
contract TheBadgeStore is TheBadgeRoles {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/ITheBadge.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";
import { IERC1155Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";

interface ITheBadge is IERC1155Upgradeable {
// Write methods
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/ITheBadgeModels.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import "../contracts/thebadge/TheBadgeStore.sol";
import { TheBadgeStore } from "../contracts/thebadge/TheBadgeStore.sol";

interface ITheBadgeModels {
// Write methods
Expand Down
3 changes: 1 addition & 2 deletions tasks/createCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";

export default task("create-collection", "Create The Badge collection").setAction(
async (hre: HardhatRuntimeEnvironment) => {
const { deployments, getNamedAccounts, ethers } = hre;
const { deployer } = await getNamedAccounts();
const { ethers } = hre;

const TheBadge = await ethers.getContractFactory("TheBadge");
const collection = await TheBadge.deploy();
Expand Down

0 comments on commit ca84a05

Please sign in to comment.