Request form
CyberConnect
  • Social
  • Identity
  • Protocol
Docs
Source
ChefGPT

CyberConnect is a Web3 social network that enables developers to create social applications empowering users to own their digital identity, content, connections, and interactions.

Create2Deployer.sol
AggregatorV3Interface.sol
AccessControl.sol
AccessControlEnumerable.sol
IAccessControl.sol
IAccessControlEnumerable.sol
Ownable.sol
draft-IERC1822.sol
ERC1967Proxy.sol
ERC1967Upgrade.sol
Proxy.sol
BeaconProxy.sol
IBeacon.sol
Initializable.sol
UUPSUpgradeable.sol
Pausable.sol
ERC1155.sol
IERC1155.sol
IERC1155Receiver.sol
ERC1155Burnable.sol
ERC1155Pausable.sol
IERC1155MetadataURI.sol
ERC1155Holder.sol
ERC1155Receiver.sol
ERC20.sol
IERC20.sol
IERC20Metadata.sol
draft-ERC20Permit.sol
draft-IERC20Permit.sol
SafeERC20.sol
IERC721.sol
IERC721Receiver.sol
ERC721Holder.sol
Address.sol
Base64.sol
Context.sol
Counters.sol
StorageSlot.sol
Strings.sol
ECDSA.sol
MerkleProof.sol
draft-EIP712.sol
ERC165.sol
IERC165.sol
EnumerableSet.sol
CyberNFTBase.sol
CyberNFTBaseFlex.sol
EIP712.sol
CyberEngine.sol
EssenceNFT.sol
ProfileNFT.sol
SubscribeNFT.sol
Pausable.sol
ReentrancyGuard.sol
Auth.sol
ERC721.sol
Owned.sol
RolesAuthority.sol
EssenceDeployer.sol
ProfileDeployer.sol
SubscribeDeployer.sol
ICyberBox.sol
ICyberBoxEvents.sol
ICyberEngine.sol
ICyberEngineEvents.sol
ICyberGrand.sol
ICyberGrandEvents.sol
ICyberNFTBase.sol
IEssenceDeployer.sol
IEssenceMiddleware.sol
IEssenceNFT.sol
IEssenceNFTEvents.sol
IMB.sol
IMBEvents.sol
IProfileDeployer.sol
IProfileMiddleware.sol
IProfileNFT.sol
IProfileNFTDescriptor.sol
IProfileNFTDescriptorV2.sol
IProfileNFTEvents.sol
ISubscribeDeployer.sol
ISubscribeMiddleware.sol
ISubscribeNFT.sol
ISubscribeNFTEvents.sol
ITreasury.sol
ITreasuryEvents.sol
IUpgradeable.sol
Actions.sol
Constants.sol
DataTypes.sol
LibString.sol
QRSVG.sol
FeeMw.sol
PermissionedMw.sol
Treasury.sol
CollectDisallowedMw.sol
CollectFlexPaidMw.sol
CollectLimitedTimePaidMw.sol
CollectMerkleDropMw.sol
CollectOnlySubscribedMw.sol
CollectPaidMw.sol
CollectPermissionMw.sol
CollectPermissionPaidMw.sol
FeeCreationMw.sol
PermissionedFeeCreationMw.sol
StableFeeCreationMw.sol
SubscribeDisallowedMw.sol
SubscribeOnlyOnceMw.sol
SubscribePaidMw.sol
CyberBoxNFT.sol
CyberGrandNFT.sol
CyberVault.sol
FrameNFT.sol
Link3ProfileDescriptor.sol
Link3ProfileDescriptorV2.sol
Link3ProfileDescriptorV3.sol
MBNFT.sol
MiniShardNFT.sol
RelationshipChecker.sol
CyberBoxNFTStorage.sol
CyberEngineStorage.sol
CyberGrandNFTStorage.sol
EssenceNFTStorage.sol
Link3ProfileDescriptorStorage.sol
Link3ProfileDescriptorStorageV2.sol
MBNFTStorage.sol
ProfileNFTStorage.sol
SubscribeNFTStorage.sol
CYBER.sol
UpgradeableBeacon.sol

6 downloads

Chains

Authors

CyberConnect
  • Social
  • Identity
  • Protocol
Info
Source
ChefGPT
Expand
Share

Get Cookin'

6 downloads

Chains

Authors

test

CyberConnect Contracts

This hosts all contracts for CyberConnect's social graph protocol.

Some opinionated design decisions:

  1. Prefer require for semantic clarity.
  2. No custom error until require supports custom error.
  3. Try to be gas efficient :)

Dependencies

Foundry (book) slither

ABI

ABI

Set Up

  1. Upgrade your foundry foundryup

  2. To enable husky pre-commit yarn && yarn prepare

  3. To install contract dependencies forge install

  4. To build forge build

  5. To test forge test -vvv

  6. (optional) To run static analysis slither src/

  7. To see contract sizes yarn size

Deployment:

(Replace rinkeby with anvil or other supported network) 0. Create .env.rinkeby file with following env

# .env.pinata
PINATA_JWT=
# .env.rinkeby
RINKEBY_RPC_URL=
PRIVATE_KEY=
ETHERSCAN_KEY=

for local deployment in .env.anvil

# .env.anvil
PRIVATE_KEY=
PINATA_JWT=
  1. Deploy Actions first with npx hardhat run --network goerli hardhat-scripts/deployActions.ts
  2. You need a Create2Deployer to start the deployment. If you don't have a contract address, run yarn deploy_deployer:goerli or change deployerContract address in Deploy.s.sol to 0 to let the script deploy. Take down the deployer contract address
  3. Run yarn deploy:goerli or yarn deploy:anvil for local deployment. If you run into any unconfirmed txs, run yarn deploy:rinkeby --resume to continue. This also verifies contract on etherscan. Check profile proxy address log to make sure it's the same as step 0. Otherwise, abort. (This manual step will be fixed)
  4. Run yarn post_deploy to update ABI changes
  5. Run yarn upload_animation:goerli to upload animation uri for link3 to ipfs.
  6. Check DeploySetting.sol and make sure the deployer contract is correctly set as shown in docs/deploy/<network>/contract.md. Run yarn set_animation_url:goerli to deploy link3 nft descriptor with animation url. Then set to profile.

Verify on Etherscan

Because we use create2 for deployments, so we need to manually submit verification.

  1. Verify CyberEngineImpl
forge verify-contract --chain-id 5 --num-of-optimizations 200 <address> src/core/CyberEngine.sol:CyberEngine  $ETHERSCAN_KEY
  1. Verify CyberEngineProxy

a. find the init_data

bytes memory data = abi.encodeWithSelector(
   CyberEngine.initialize.selector,
   address(0),
   authority
);
console.logBytes(data);

b. verify

forge verify-contract --chain-id 5 --num-of-optimizations 200 <address> lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy --constructor-args $(cast abi-encode "constructor(address,bytes)" <impl_address> <init_data>)  $ETHERSCAN_KEY
  1. Verify Profile

Tests

QRCode

License

GNU General Public License v3.0 or later

See COPYING to see the full text.

CyberConnect is a Web3 social network that enables developers to create social applications empowering users to own their digital identity, content, connections, and interactions.
Create2Deployer.sol
AggregatorV3Interface.sol
AccessControl.sol
AccessControlEnumerable.sol
IAccessControl.sol
IAccessControlEnumerable.sol
Ownable.sol
draft-IERC1822.sol
ERC1967Proxy.sol
ERC1967Upgrade.sol
Proxy.sol
BeaconProxy.sol
IBeacon.sol
Initializable.sol
UUPSUpgradeable.sol
Pausable.sol
ERC1155.sol
IERC1155.sol
IERC1155Receiver.sol
ERC1155Burnable.sol
ERC1155Pausable.sol
IERC1155MetadataURI.sol
ERC1155Holder.sol
ERC1155Receiver.sol
ERC20.sol
IERC20.sol
IERC20Metadata.sol
draft-ERC20Permit.sol
draft-IERC20Permit.sol
SafeERC20.sol
IERC721.sol
IERC721Receiver.sol
ERC721Holder.sol
Address.sol
Base64.sol
Context.sol
Counters.sol
StorageSlot.sol
Strings.sol
ECDSA.sol
MerkleProof.sol
draft-EIP712.sol
ERC165.sol
IERC165.sol
EnumerableSet.sol
CyberNFTBase.sol
CyberNFTBaseFlex.sol
EIP712.sol
CyberEngine.sol
EssenceNFT.sol
ProfileNFT.sol
SubscribeNFT.sol
Pausable.sol
ReentrancyGuard.sol
Auth.sol
ERC721.sol
Owned.sol
RolesAuthority.sol
EssenceDeployer.sol
ProfileDeployer.sol
SubscribeDeployer.sol
ICyberBox.sol
ICyberBoxEvents.sol
ICyberEngine.sol
ICyberEngineEvents.sol
ICyberGrand.sol
ICyberGrandEvents.sol
ICyberNFTBase.sol
IEssenceDeployer.sol
IEssenceMiddleware.sol
IEssenceNFT.sol
IEssenceNFTEvents.sol
IMB.sol
IMBEvents.sol
IProfileDeployer.sol
IProfileMiddleware.sol
IProfileNFT.sol
IProfileNFTDescriptor.sol
IProfileNFTDescriptorV2.sol
IProfileNFTEvents.sol
ISubscribeDeployer.sol
ISubscribeMiddleware.sol
ISubscribeNFT.sol
ISubscribeNFTEvents.sol
ITreasury.sol
ITreasuryEvents.sol
IUpgradeable.sol
Actions.sol
Constants.sol
DataTypes.sol
LibString.sol
QRSVG.sol
FeeMw.sol
PermissionedMw.sol
Treasury.sol
CollectDisallowedMw.sol
CollectFlexPaidMw.sol
CollectLimitedTimePaidMw.sol
CollectMerkleDropMw.sol
CollectOnlySubscribedMw.sol
CollectPaidMw.sol
CollectPermissionMw.sol
CollectPermissionPaidMw.sol
FeeCreationMw.sol
PermissionedFeeCreationMw.sol
StableFeeCreationMw.sol
SubscribeDisallowedMw.sol
SubscribeOnlyOnceMw.sol
SubscribePaidMw.sol
CyberBoxNFT.sol
CyberGrandNFT.sol
CyberVault.sol
FrameNFT.sol
Link3ProfileDescriptor.sol
Link3ProfileDescriptorV2.sol
Link3ProfileDescriptorV3.sol
MBNFT.sol
MiniShardNFT.sol
RelationshipChecker.sol
CyberBoxNFTStorage.sol
CyberEngineStorage.sol
CyberGrandNFTStorage.sol
EssenceNFTStorage.sol
Link3ProfileDescriptorStorage.sol
Link3ProfileDescriptorStorageV2.sol
MBNFTStorage.sol
ProfileNFTStorage.sol
SubscribeNFTStorage.sol
CYBER.sol
UpgradeableBeacon.sol