Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'triage needed'
assignees: ''
title: ""
labels: "triage needed"
assignees: ""
---

**⚠️ CAUTION: Any issue related to trading / price / not related with the code directly within this repository will be closed without comment**
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'triage needed'
assignees: ''
title: ""
labels: "triage needed"
assignees: ""
---

**⚠️ CAUTION: Any issue related to trading / price / not related with the code directly within this repository will be closed without comment**
Expand Down
2 changes: 1 addition & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
skipFiles: ['test'],
skipFiles: ["test"],
};
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ The WindingTree market protocol smart contracts and utilities
- Config ([0x098b1d12cAfE7315C77b6d308A62ce02806260Ee](https://explorer.public.zkevm-test.net/address/0x098b1d12cAfE7315C77b6d308A62ce02806260Ee/read-proxy#address-tabs)): the protocol configuration smart contract
- EntitiesRegistry ([0x4bB51528C83844b509E1152EEb05260eE1bf60e6](https://explorer.public.zkevm-test.net/address/0x4bB51528C83844b509E1152EEb05260eE1bf60e6/read-proxy#address-tabs)): the protocol identity management
- Market ([0xDd5B6ffB3585E109ECddec5293e31cdc1e9DeD57](https://explorer.public.zkevm-test.net/address/0xDd5B6ffB3585E109ECddec5293e31cdc1e9DeD57/read-proxy#address-tabs)): the protocol entry point
- LIF ([0xba515AB7FfDa899a2e6c8FDbcDf351c8c15f4009](https://explorer.public.zkevm-test.net/address/0xba515AB7FfDa899a2e6c8FDbcDf351c8c15f4009/read-proxy#address-tabs)): Test version of LIF token
- LIF ([0x4d60F4483BaA654CdAF1c5734D9E6B16735efCF8](https://explorer.public.zkevm-test.net/address/0x4d60F4483BaA654CdAF1c5734D9E6B16735efCF8/read-proxy#address-tabs)): Test version of LIF token

#### Testing tokens

- `STABLE6`: [ERC20, 6 decimals, no permit](https://explorer.public.zkevm-test.net/address/0x8CB96383609C56af1Fe44DB7591F94AEE2fa43b2/read-proxy#address-tabs)
- `STABLE6PERMIT`: [ERC20, 6 decimals, with permit](https://explorer.public.zkevm-test.net/address/0x4556d5C1486d799f67FA96c84F1d0552486CAAF4/read-proxy#address-tabs)
- `STABLE18`: [ERC20, 18 decimals, no permit](https://explorer.public.zkevm-test.net/address/0x4EcB659060Da61D795D777bb21BAe3599b301C66/read-proxy#address-tabs)
- `STABLE18PERMIT`: [ERC20, 18 decimals, with permit](https://explorer.public.zkevm-test.net/address/0xF54784206A53EF19fd3024D8cdc7A6251A4A0d67/read-proxy#address-tabs)

## Install package

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockERC20Dec18.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
pragma solidity ^0.8.19;

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockERC20Dec18Permit.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
pragma solidity ^0.8.19;

import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol";
import "./MockERC20Dec18.sol";
Expand Down
11 changes: 11 additions & 0 deletions contracts/test/MockERC20Dec6.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "./MockERC20Dec18.sol";

/// @custom:security-contact security@windingtree.com
contract MockERC20Dec6 is MockERC20Dec18 {
function decimals() public pure override returns (uint8) {
return 6;
}
}
11 changes: 11 additions & 0 deletions contracts/test/MockERC20Dec6Permit.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "./MockERC20Dec18Permit.sol";

/// @custom:security-contact security@windingtree.com
contract MockERC20Dec6Permit is MockERC20Dec18Permit {
function decimals() public pure override returns (uint8) {
return 6;
}
}
46 changes: 23 additions & 23 deletions deploy/001.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/unbound-method */
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import {
kindsArr,
eip712name,
Expand All @@ -9,12 +9,12 @@ import {
protocolFee,
retailerFee,
minDeposit,
} from '../utils/constants';
} from "../utils/constants";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { network, deployments, getNamedAccounts } = hre;

if (!['hardhat', 'localhost'].includes(network.name)) {
if (!["hardhat", "localhost"].includes(network.name)) {
return;
}

Expand All @@ -23,16 +23,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const PROXY_SETTINGS_WITH_UPGRADE = {
owner,
proxyContract: 'OpenZeppelinTransparentProxy',
proxyContract: "OpenZeppelinTransparentProxy",
};

// Simple ERC20 token
const erc20 = await deploy('MockERC20Dec18', {
const erc20 = await deploy("MockERC20Dec18", {
proxy: {
...PROXY_SETTINGS_WITH_UPGRADE,
execute: {
methodName: 'initialize',
args: ['STABLE', 'STABLE', owner],
methodName: "initialize",
args: ["STABLE", "STABLE", owner],
},
},
from: owner,
Expand All @@ -43,17 +43,17 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (erc20.newlyDeployed) {
console.log(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`MockERC20Dec18 (erc20) was deployed at: ${erc20.address} using ${erc20.receipt?.gasUsed} gas`,
`MockERC20Dec18 (erc20) was deployed at: ${erc20.address} using ${erc20.receipt?.gasUsed} gas`
);
}

// ERC20 token with permit
const lif = await deploy('MockERC20Dec18Permit', {
const lif = await deploy("MockERC20Dec18Permit", {
proxy: {
...PROXY_SETTINGS_WITH_UPGRADE,
execute: {
methodName: 'initialize',
args: ['LifToken', 'LIF', owner],
methodName: "initialize",
args: ["LifToken", "LIF", owner],
},
},
from: owner,
Expand All @@ -64,16 +64,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (lif.newlyDeployed) {
console.log(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`MockERC20Dec18Permit (lif) was deployed at: ${lif.address} using ${lif.receipt?.gasUsed} gas`,
`MockERC20Dec18Permit (lif) was deployed at: ${lif.address} using ${lif.receipt?.gasUsed} gas`
);
}

// Protocol Config
const protocolConfig = await deploy('Config', {
const protocolConfig = await deploy("Config", {
proxy: {
...PROXY_SETTINGS_WITH_UPGRADE,
execute: {
methodName: 'initialize',
methodName: "initialize",
args: [
owner,
lif.address,
Expand All @@ -94,16 +94,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (protocolConfig.newlyDeployed) {
console.log(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`Config was deployed at: ${protocolConfig.address} using ${protocolConfig.receipt?.gasUsed} gas`,
`Config was deployed at: ${protocolConfig.address} using ${protocolConfig.receipt?.gasUsed} gas`
);
}

// EntitiesRegistry
const entities = await deploy('EntitiesRegistry', {
const entities = await deploy("EntitiesRegistry", {
proxy: {
...PROXY_SETTINGS_WITH_UPGRADE,
execute: {
methodName: 'initialize',
methodName: "initialize",
args: [owner, protocolConfig.address],
},
},
Expand All @@ -115,16 +115,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (entities.newlyDeployed) {
console.log(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`EntitiesRegistry was deployed at: ${entities.address} using ${entities.receipt?.gasUsed} gas`,
`EntitiesRegistry was deployed at: ${entities.address} using ${entities.receipt?.gasUsed} gas`
);
}

// Market
const market = await deploy('Market', {
const market = await deploy("Market", {
proxy: {
...PROXY_SETTINGS_WITH_UPGRADE,
execute: {
methodName: 'initialize',
methodName: "initialize",
args: [
owner,
eip712name,
Expand All @@ -142,10 +142,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (market.newlyDeployed) {
console.log(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`Market was deployed at: ${market.address} using ${market.receipt?.gasUsed} gas`,
`Market was deployed at: ${market.address} using ${market.receipt?.gasUsed} gas`
);
}
};

export default func;
func.tags = ['MockERC20Dec18', 'MockERC20Dec18Permit', 'Market'];
func.tags = ["MockERC20Dec18", "MockERC20Dec18Permit", "Market"];
Loading