Skip to content

Commit 76f350e

Browse files
committed
Merge branch 'main' into joaquim/twcontract
2 parents 216379d + 8452bd4 commit 76f350e

File tree

4 files changed

+51
-9
lines changed

4 files changed

+51
-9
lines changed

contracts/yarn.lock

Lines changed: 0 additions & 4 deletions
This file was deleted.

release.sh

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
#!/usr/bin/env bash
22

3-
# Exit script as soon as a command fails.
4-
set -o errexit
3+
POSITIONAL_ARGS=()
4+
5+
while [[ $# -gt 0 ]]; do
6+
case $1 in
7+
--local)
8+
local=1
9+
shift # past argument
10+
;;
11+
--no-build)
12+
skip_build=1
13+
shift # past argument
14+
;;
15+
-*|--*)
16+
echo "Unknown option $1"
17+
exit 1
18+
;;
19+
*)
20+
POSITIONAL_ARGS+=("$1") # save positional arg
21+
shift # past argument
22+
;;
23+
esac
24+
done
25+
26+
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
527

628
echo "### Release script started..."
29+
if [[ $skip_build -eq 0 ]]; then
730
yarn build
31+
fi
832
echo "### Build finished. Copying abis."
933
rm -rf contracts/abi
1034
mkdir -p contracts/abi
@@ -18,7 +42,11 @@ cp README.md contracts/README.md
1842
# publish from contracts folder
1943
cd contracts
2044
echo "### Publishing..."
45+
if [[ $local -eq 1 ]]; then
46+
yalc push
47+
else
2148
np --any-branch --no-tests
49+
fi
2250
# delete copied README
2351
rm README.md
2452
# back to root folder

scripts/deploy/marketplace.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ import hre, { ethers } from "hardhat";
33
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
44
import { TWFactory, Marketplace } from "typechain";
55

6+
import { nativeTokenWrapper } from "../../utils/nativeTokenWrapper";
7+
68
async function main() {
9+
10+
const chainId: number = hre.network.config.chainId as number;
11+
712
const [caller]: SignerWithAddress[] = await ethers.getSigners();
813

9-
const nativeTokenWrapperAddress: string = ethers.constants.AddressZero; // replace
14+
const nativeTokenWrapperAddress: string = nativeTokenWrapper[chainId];
1015
const twFeeAddress: string = ethers.constants.AddressZero; // replace
11-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
16+
const twFactoryAddress: string = ethers.constants.AddressZero; // replace Fantom: 0x97EA0Fcc552D5A8Fb5e9101316AAd0D62Ea0876B rest: 0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0
1217

1318
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
1419

@@ -21,7 +26,7 @@ async function main() {
2126
}
2227
const marketplace: Marketplace = await ethers
2328
.getContractFactory("Marketplace")
24-
.then(f => f.deploy(nativeTokenWrapperAddress, twFeeAddress));
29+
.then(f => f.deploy(nativeTokenWrapperAddress, twFeeAddress, { gasPrice: ethers.utils.parseUnits("300", "gwei") }));
2530

2631
console.log(
2732
"Deploying Marketplace \ntransaction: ",
@@ -30,6 +35,8 @@ async function main() {
3035
marketplace.address,
3136
);
3237

38+
await marketplace.deployed();
39+
3340
console.log("\n");
3441

3542
const addImplementationTx = await twFactory.addImplementation(marketplace.address);

utils/nativeTokenWrapper.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const nativeTokenWrapper: Record<number, string> = {
2+
1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
3+
4: "0xc778417E063141139Fce010982780140Aa0cD5Ab", // rinkeby
4+
5: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", // goerli
5+
137: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
6+
80001: "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889",
7+
43114: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
8+
43113: "0xd00ae08403B9bbb9124bB305C09058E32C39A48c",
9+
250: "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
10+
4002: "0xf1277d1Ed8AD466beddF92ef448A132661956621",
11+
};

0 commit comments

Comments
 (0)