Skip to content

Instantly share code, notes, and snippets.

View Princeigwe's full-sized avatar
🧩
Building

Prince Igwe Princeigwe

🧩
Building
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import './interfaces/IDiamondCut.sol';
import './interfaces/IDiamondLoupe.sol';
import './libraries/LibProfileTokenStorage.sol';
contract ProfileTokenDiamond {
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import { IDiamondCut } from "../interfaces/IDiamondCut.sol";
import { IDiamondLoupe } from "../interfaces/IDiamondLoupe.sol"; // new
library LibProfileTokenStorage {
bytes32 constant PROFILE_TOKEN_STRUCT_POSITION = keccak256("profile.token.diamond.storage");
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
interface IDiamondLoupe{
// hold detail about a facet and its selectors
struct Facet{
address facetAddress;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import { IDiamondCut } from "../interfaces/IDiamondCut.sol";
library LibProfileTokenStorage {
bytes32 constant PROFILE_TOKEN_STRUCT_POSITION = keccak256("profile.token.diamond.storage");
struct FacetAddressAndFunctionSelectorPosition{
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import { IDiamondCut } from "../interfaces/IDiamondCut.sol"; //** new */
library LibProfileTokenStorage {
bytes32 constant PROFILE_TOKEN_STRUCT_POSITION = keccak256("profile.token.diamond.storage");
struct FacetAddressAndFunctionSelectorPosition{
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
// this is the interface for the diamond cut facet, which is used to add, replace and remove functions from the diamond
interface IDiamondCut {
enum FacetCutAction { Add, Replace, Remove }
struct FacetCut {
address facetAddress;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
library LibProfileTokenStorage {
// keccak hash of a unique string, which will be used for the location
// of the diamond storage in the main contract storage
bytes32 constant PROFILE_TOKEN_STRUCT_POSITION = keccak256("profile.token.diamond.storage");
version: 2.1
jobs:
blog_demo_deployment_process:
docker:
- image: cimg/node:19.8.1
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
steps:
version: 2.1
jobs:
blog_demo_deployment_process:
docker:
- image: cimg/node:19.8.1
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
steps:
version: 2.1
jobs:
blog_demo_deployment_process:
docker:
- image: cimg/node:19.8.1
auth: # new
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
steps: