Skip to content

Commit

Permalink
feat: update deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert committed Sep 7, 2023
1 parent 5060372 commit fe333c5
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 316 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ solhint :; solhint -f table "{contracts,test,scripts}/**/*.sol"

# slither
# to install slither, visit [https://github.com/crytic/slither]
slither :; slither . --fail-low
slither :; slither . --fail-low #--triage-mode

# mythril
mythril :
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## Crossbell NFT MarketPlace
## Crossbell xShop contracts

[![Docs](https://github.com/Crossbell-Box/crossbell-marketplace-contracts/actions/workflows/docs.yml/badge.svg)](https://github.com/Crossbell-Box/crossbell-marketplace-contracts/actions/workflows/docs.yml)
[![lint](https://github.com/Crossbell-Box/crossbell-marketplace-contracts/actions/workflows/lint.yml/badge.svg)](https://github.com/Crossbell-Box/crossbell-marketplace-contracts/actions/workflows/lint.yml)
Expand All @@ -9,19 +9,25 @@
[![MythXBadge](https://badgen.net/https/api.mythx.io/v1/projects/e7178a58-97ab-4362-a5ab-2caa3fbd3a64/badge/data?cache=300&icon=https://raw.githubusercontent.com/ConsenSys/mythx-github-badge/main/logo_white.svg)](https://docs.mythx.io/dashboard/github-badges)


**Setup**
```bash
yarn
## ⚙ Development

Install foundry if you don't have one:
```shell
# install foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
```

**Testing**
```bash
Compile and run tests:
```shell
yarn
yarn test
```


**Deploy**
```shell
npx hardhat run scripts/deployMarketPlace.ts
forge script scripts/Deploy.s.sol:Deploy --private-key $PRIVATE_KEY --broadcast --legacy --rpc-url $RPC_URL --ffi
forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --private-key $PRIVATE_KEY --broadcast --legacy --rpc-url $RPC_URL --ffi
```

2 changes: 1 addition & 1 deletion contracts/Swap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract Swap is
uint256 internal _minCsb; // minimum CSB amount to sell
uint256 internal _minMira; // minimum MIRA amount to sell

mapping(uint256 => DataTypes.SellOrder) internal _orders;
mapping(uint256 orderId => DataTypes.SellOrder sellOrder) internal _orders;
uint256 internal _orderCount;

uint8 public constant SELL_MIRA = 1;
Expand Down
12 changes: 7 additions & 5 deletions contracts/storage/MarketPlaceStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ contract MarketPlaceStorage {

uint256 internal _askOrderCount;
// @notice askOrderId -> Order
mapping(uint256 => DataTypes.Order) internal _askOrders;
mapping(uint256 askOrderId => DataTypes.Order askOrder) internal _askOrders;
// @notice nftAddress -> tokenId -> owner -> askOrderId
mapping(address => mapping(uint256 => mapping(address => uint256))) internal _askOrderIds;
mapping(address nftAddress => mapping(uint256 tokenId => mapping(address owner => uint256 askOrderId)))
internal _askOrderIds;

uint256 internal _bidOrderCount;
// @notice bidOrderId -> Order
mapping(uint256 => DataTypes.Order) internal _bidOrders;
// @notice nftAddress -> tokenId -> owner -> Order
mapping(address => mapping(uint256 => mapping(address => uint256))) internal _bidOrderIds;
mapping(uint256 bidOrderId => DataTypes.Order bidOrder) internal _bidOrders;
// @notice nftAddress -> tokenId -> owner -> bidOrderId
mapping(address nftAddress => mapping(uint256 tokenId => mapping(address owner => uint256 bidOrderId)))
internal _bidOrderIds;
}
// slither-disable-end naming-convention
14 changes: 6 additions & 8 deletions deploy-config/crossbell.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"chainID": 3737,
"proxyAdminOwner": "0x5f603895B48F0C451af39bc7e0c587aE15718e4d",
"web3EntryTokenName": "Web3 Entry Character",
"web3EntryTokenSymbol": "WEC",
"linklistTokenName": "Link List Token",
"linklistTokenSymbol": "LLT",
"xsyncOperator": "0x0F588318A494e4508A121a32B6670b5494Ca3357",
"miraToken": "0xAfB95CC0BD320648B3E8Df6223d9CDD05EbeDC64",
"newbieVillaAdmin": "0x5f603895B48F0C451af39bc7e0c587aE15718e4d"
"proxyAdminOwner": "0xc72cE0090718502f08506c4592F18f13094d4CE3",
"admin": "0x4BCe096F44b90B812420637068dC215C1C3C8B54",
"wcsb": "0xff823B6138089Bea84E8d67fcb68f786e7Feb118",
"mira": "0xb402548B1f3fE59211B19832C5b659bB4d4Abd42",
"minCsb": 100000000000000000000,
"minMira": 100000000000000000000
}
9 changes: 8 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ cache_path = 'cache_foundry'
fuzz_runs = 1_000
libs = ["node_modules", "lib"]

fs_permissions = [
{ access='read-write', path='./deployments/' },
{ access='read', path='./deploy-config/' },
{ access='read', path='./broadcast/' },
{ access='read', path = './artifacts_foundry/' },
]

# Extreme Fuzzing CI Profile :P
[profile.ci]
fuzz_runs = 256
fuzz_runs = 1_000
2 changes: 1 addition & 1 deletion lib/forge-std
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "crossbell-marketplace-contracts",
"name": "xShop-contracts",
"license": "MIT",
"version": "1.0.0",
"files": [
Expand All @@ -9,7 +9,7 @@
"@nomiclabs/hardhat-ethers": "^2.0.6",
"@nomiclabs/hardhat-etherscan": "^3.1.0",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@openzeppelin/contracts": "4.8.1",
"@openzeppelin/contracts": "4.9.0",
"@typechain/ethers-v5": "^7.0.1",
"@typechain/hardhat": "^6.1.5",
"@types/mocha": "^10.0.0",
Expand Down
Loading

0 comments on commit fe333c5

Please sign in to comment.