Skip to content

Commit

Permalink
Merge branch 'dev' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
zapaz committed Apr 22, 2024
2 parents b990d41 + 4169ccb commit 003e38a
Show file tree
Hide file tree
Showing 134 changed files with 2,536 additions and 1,621 deletions.
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
branch = v1
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
branch = release-v4.8
[submodule "contracts/lib/openzeppelin-contracts-upgradeable"]
path = contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/openzeppelin/openzeppelin-contracts-upgradeable
branch = release-v4.8
[submodule "contracts/lib/OpenNFTs"]
path = contracts/lib/OpenNFTs
url = https://github.com/kredeum/OpenNFTs
branch = main
[submodule "contracts/lib/forge-deploy-lite"]
path = contracts/lib/forge-deploy-lite
url = https://github.com/zapaz/forge-deploy-lite
branch = dev
3 changes: 3 additions & 0 deletions common/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ module.exports = {
},
ignorePatterns: ["node_modules"],
rules: {
"prefer-const" : "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
Expand Down
24 changes: 12 additions & 12 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"dependencies": {
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/address": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@ipld/dag-pb": "^4.1.0",
"@types/findup-sync": "^4.0.4",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.27",
"@kredeum/config": "workspace:^",
"@kredeum/contracts": "workspace:^",
"@kredeum/providers": "workspace:^",
"ethers": "^5.7.2",
"findup-sync": "^5.0.0",
"fs-extra": "^11.2.0",
"multiformats": "^13.1.0",
"tslib": "^2.6.2",
"typescript": "^5.4.2"
"viem": "^2.9.21"
},
"dependencies": {
"@kredeum/config": "workspace:^",
"@kredeum/contracts": "workspace:^"
"devDependencies": {
"@ipld/dag-pb": "^4.1.0",
"@types/findup-sync": "^4.0.5",
"@types/node": "^20.12.7",
"findup-sync": "^5.0.0",
"tslib": "^2.6.2",
"typescript": "^5.4.5"
}
}
4 changes: 2 additions & 2 deletions common/src/common/fetchBee.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { storageParamsGet } from "@common/storage/storage";
import { SWARM_ZERO_APIKEY } from "@common/storage/swarm";
import { storageParamsGet } from "../storage/storage";
import { SWARM_ZERO_APIKEY } from "../storage/swarm";

const fetchBee = (() => {
const uploadBlob = async (body: Blob): Promise<string> => {
Expand Down
2 changes: 1 addition & 1 deletion common/src/nft/nft.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReceiverType, NftType } from "../common/types";
import { type ReceiverType, type NftType } from "../common/types";
import { MAX_FEE, feeAmount, treasuryFee } from "../common/config";

import { BigNumber } from "ethers";
Expand Down
2 changes: 1 addition & 1 deletion common/src/storage/swarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DEFAULT_NAME, textShort } from "../common/config";

import { storageDefault, storageParamsGet, storageParamsValid } from "./storage";
import { networks } from "../common/networks";
import { fetchBee } from "@common/common/fetchBee";
import { fetchBee } from "../common/fetchBee";

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SWARM HELPERS
Expand Down
9 changes: 2 additions & 7 deletions common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"baseUrl": "../",
"paths": {
"@common/*": ["common/src/*"],
"@svelte/*": ["svelte/src/*"]
}
"resolveJsonModule": true
},
"include": ["**/*.ts"]
"include": ["src/**/*.ts"]
}
2 changes: 1 addition & 1 deletion config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "ISC",
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.27",
"@types/node": "^20.12.7",
"eslint-plugin-json": "^3.1.0",
"fs-extra": "^11.2.0",
"handlebars": "^4.7.8"
Expand Down
2 changes: 1 addition & 1 deletion config/src/config.handlebars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": {
"latest": "1.3.2",
"latest": "1.4.0",
"stable": "1.1.4",
"branch": "{{GIT_BRANCH}}",
"commit": "{{GIT_COMMIT}}"
Expand Down
18 changes: 18 additions & 0 deletions config/src/testnets.handlebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,24 @@
"create": true,
"linkedMainnet": 1564830818
},
{
"chainId": 974399131,
"chainName": "calypso-testnet",
"rpcUrls": [
"https://testnet.skalenodes.com/v1/giant-half-dual-testnet"
],
"nativeCurrency": {
"name": "sFUEL",
"symbol": "SFUEL",
"decimals": 18
},
"blockExplorerUrls": [
"https://giant-half-dual-testnet.explorer.testnet.skalenodes.com"
],
"eip1559": false,
"create": true,
"linkedMainnet": 1564830818
},
{
"chainId": 3441005,
"chainName": "manta-pacific-testnet",
Expand Down
5 changes: 2 additions & 3 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"baseUrl": "./",
"resolveJsonModule": true
},
"include": ["**/*.ts"],
"include": ["scripts/**/*.ts"],
}
2 changes: 1 addition & 1 deletion config/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"build": {
"dependsOn": ["check"],
"inputs": ["src/*.json"],
"inputs": ["src/*.json", "scripts/*.ts"],
"outputs": ["dist/*.json"]
}
}
Expand Down
6 changes: 6 additions & 0 deletions contracts/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
"OpenNFTsV4": "0x485ed00c43e919E02279Ca137343B2aC63EF0eF2",
"chainName": "chaos-testnet"
},
"974399131": {
"OpenNFTsFactoryV3": "0x0e4B980c44feF474e650BfdE5020aAA7aCAe6f06",
"OpenNFTsResolver": "0x9ffa4fa32d2ac629b8F39Cb226a5dC3508D1e78d",
"OpenNFTsV4": "0x37C3aAbb1C9c3c344BbD5801AefDaf40180Be070",
"chainName": "calypso-testnet"
},
"137": {
"OpenAutoMarket": "0x5Cf67C52eD5608B9841238bCc2bDe012263b7111",
"OpenBound": "0xE82984f872B68B6B369D5700654F229ba6f57c42",
Expand Down
6 changes: 4 additions & 2 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ zora = "https://rpc.zora.energy"
mantle = "https://rpc.ankr.com/mantle"
mode = "https://mainnet.mode.network"
manta-pacific = "https://pacific-rpc.manta.network/http"
blast = "https://rpc.blast.io"
blast = "https://blast-mainnet.infura.io/v3/${INFURA_API_KEY}"

# TESTNETS
anvil = "http://127.0.0.1:8545"
Expand All @@ -56,8 +56,9 @@ mantle-testnet = "https://rpc.testnet.mantle.xyz"
mode-sepolia = "https://sepolia.mode.network"
manta-pacific-testnet = "https://pacific-rpc.testnet.manta.network/http"
chaos-testnet = "https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix"
calypso-testnet = "https://testnet.skalenodes.com/v1/giant-half-dual-testnet"
taiko-katla = "https://rpc.katla.taiko.xyz"
blast-sepolia = "https://sepolia.blast.io"
blast-sepolia = "https://blast-sepolia.infura.io/v3/${INFURA_API_KEY}"

[etherscan]
gnosis = { key = "${ETHERSCAN_API_KEY_GNOSIS}" }
Expand All @@ -69,6 +70,7 @@ linea = { key = "${ETHERSCAN_API_KEY_LINEA}" }
goerli = { key = "${ETHERSCAN_API_KEY}" }
sepolia = { key = "${ETHERSCAN_API_KEY}" }
holesky = { key = "${ETHERSCAN_API_KEY}", url = "https://api-holesky.etherscan.io/api" }
calypso-testnet = { key = "non-applicable", url = "https://giant-half-dual-testnet.explorer.testnet.skalenodes.com" }

linea-testnet = { key = "${ETHERSCAN_API_KEY_LINEA}" }
base-sepolia = { key = "${ETHERSCAN_API_KEY_BASE}" }
Expand Down
11 changes: 5 additions & 6 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"@typechain/ethers-v5": "^11.1.2",
"ethers": "^5.7.2",
"solc": "0.8.19",
"solhint": "^4.1.1",
"solidity-coverage": "^0.8.11",
"solhint": "^4.5.4",
"solidity-coverage": "^0.8.12",
"typechain": "^8.3.2",
"typescript": "^5.4.2"
"typescript": "^5.4.5"
},
"directories": {
"test": "tests"
Expand All @@ -22,7 +22,7 @@
"main": "index.js",
"scripts": {
"clean": "forge clean && rm -rf cache-forge out node_modules lib types artifacts broadcast .turbo",
"postinstall": "pnpm install:foundry && pnpm forge:init && pnpm forge:update",
"postinstall": "pnpm install:foundry && pnpm forge:update",
"install:foundry": "command -v forge >/dev/null 2>&1 || pnpm foundry:install",
"build": "pnpm build:forge && pnpm build:typechain",
"build:forge": "$HOME/.foundry/bin/forge build",
Expand All @@ -39,8 +39,7 @@
"validate:only": "pnpm deploy:all --sender $SENDER",
"format": "pnpm format:solidity",
"format:solidity": "$HOME/.foundry/bin/forge fmt",
"foundry:install": "curl -L https://foundry.paradigm.xyz | bash && $HOME/.foundry/bin/foundryup && pnpm forge:init",
"forge:init": "$HOME/.foundry/bin/forge init --force --no-commit && rm -f **/Counter*.sol",
"foundry:install": "curl -L https://foundry.paradigm.xyz | bash && $HOME/.foundry/bin/foundryup && pnpm forge:update",
"forge:update": "git submodule update --recursive",
"tests": "pnpm tests:forge",
"tests:forge": "forge test"
Expand Down
6 changes: 3 additions & 3 deletions contracts/scripts/ChangeOwner.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract ChangeOwner is Script, DeployLite {
address openNFTsV4Owner;
address openAutoMarketOwner;

function logAdressesAndOwners() public {
function logAddressesAndOwners() public {
console.log(" ");

openFactoryOwner = openFactory.owner();
Expand Down Expand Up @@ -53,7 +53,7 @@ contract ChangeOwner is Script, DeployLite {
uint256 countCollections = OpenNFTsResolver(openResolver).countAddresses();
console.log("%s collections %s templates", countCollections, countTemplates);

logAdressesAndOwners();
logAddressesAndOwners();

// send value to pay for gas of next transactions
// address paymaster = 0x981ab0D817710d8FFFC5693383C00D985A3BDa38;
Expand Down Expand Up @@ -85,7 +85,7 @@ contract ChangeOwner is Script, DeployLite {
OpenERC173(openAutoMarket).transferOwnership(newOwner);
}

logAdressesAndOwners();
logAddressesAndOwners();
}
}
}
10 changes: 5 additions & 5 deletions contracts/scripts/DeployAllNext.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ contract DeployAllNext is
{
console.log("chainId %s msg.sender @%s", block.chainid, msg.sender);

deploy("OpenNFTsFactoryV3");
deploy("OpenNFTsResolverV4");
deploy("OpenNFTsV5");
deploy("OpenAutoMarket");
deploy("OpenBound");
deployOpenNFTsFactoryV3();
deployOpenNFTsResolverV4();
deployOpenNFTsV5();
deployOpenAutoMarket();
deployOpenBound();
}
}
2 changes: 1 addition & 1 deletion contracts/scripts/deploy/DeployOpenAutoMarket.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract DeployOpenAutoMarket is DeployLite {
if (state == DeployState.None) {
vm.startBroadcast();

address openAutoMarket = deploy("OpenAutoMarket");
address openAutoMarket = deployLite("OpenAutoMarket", "");

bool[] memory options = new bool[](2);
options[0] = true;
Expand Down
4 changes: 2 additions & 2 deletions contracts/scripts/deploy/DeployOpenNFTsFactoryV3.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ contract DeployOpenNFTsFactoryV3 is DeployLite {
uint96 treasuryFee = 90;

bytes memory args = abi.encode(msg.sender, treasuryAccount, treasuryFee);
DeployState state = deployState("OpenNFTsFactoryV3", args);
DeployState state = deployState("OpenNFTsFactoryV3");

if (state == DeployState.None) {
vm.broadcast();
deploy("OpenNFTsFactoryV3", args);
deployLite("OpenNFTsFactoryV3", args);
}

return readAddress("OpenNFTsFactoryV3");
Expand Down
4 changes: 2 additions & 2 deletions contracts/scripts/deploy/DeployOpenNFTsResolver.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ contract DeployOpenNFTsResolver is DeployLite, DeployOpenNFTsFactoryV3 {
);

bytes memory args = abi.encode(msg.sender, openNFTsFactoryV3);
DeployState state = deployState("OpenNFTsResolver", args);
DeployState state = deployState("OpenNFTsResolver");

if (state == DeployState.None) {
vm.startBroadcast();

address openNFTsResolver = deploy("OpenNFTsResolver", args);
address openNFTsResolver = deployLite("OpenNFTsResolver", args);

OpenNFTsFactoryV3(openNFTsFactoryV3).setResolver(openNFTsResolver);

Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/deploy/DeployOpenNFTsV4.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract DeployOpenNFTsV4 is DeployLite {
if (state == DeployState.None) {
vm.startBroadcast(msg.sender);

address openNFTsV4 = deploy("OpenNFTsV4");
address openNFTsV4 = deployLite("OpenNFTsV4", "");

bool[] memory options = new bool[](1);
options[0] = true;
Expand Down
6 changes: 6 additions & 0 deletions contracts/src/interfaces/IERC165.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
26 changes: 26 additions & 0 deletions contracts/src/interfaces/IERC721.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IERC721 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external payable;

function safeTransferFrom(address from, address to, uint256 tokenId) external payable;

function transferFrom(address from, address to, uint256 tokenId) external payable;

function approve(address to, uint256 tokenId) external;

function setApprovalForAll(address operator, bool approved) external;

function balanceOf(address owner) external view returns (uint256 balance);

function ownerOf(uint256 tokenId) external view returns (address owner);

function getApproved(uint256 tokenId) external view returns (address operator);

function isApprovedForAll(address owner, address operator) external view returns (bool);
}
Loading

0 comments on commit 003e38a

Please sign in to comment.