Skip to content

Commit

Permalink
Prepare for deploying the contracts and build artifacts to npmjs
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Apr 15, 2020
1 parent 843d02b commit 6cf43db
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 579 deletions.
2 changes: 1 addition & 1 deletion .waffle.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"solcVersion": "./node_modules/solc",
"compilerVersion": "./node_modules/solc",
"outputType": "all",
"compilerOptions": {
"outputSelection": {
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{
"name": "@uniswap/v2-core",
"version": "1.0.0-beta.0",
"files": [
"contracts",
"build"
],
"engines": {
"node": ">=10"
},
"devDependencies": {
"@types/chai": "^4.2.6",
"@types/mocha": "^5.2.7",
"chai": "^4.2.0",
"ethereum-waffle": "^2.3.1",
"ethereum-waffle": "^2.4.1",
"ethereumjs-util": "^6.2.0",
"mocha": "^6.2.2",
"prettier": "^1.19.1",
Expand All @@ -22,7 +28,8 @@
"compile": "waffle .waffle.json",
"pretest": "yarn compile",
"test": "mocha",
"check-compile-output": "./scripts/check-compile-output.sh"
"check-compile-output": "./scripts/check-compile-output.sh",
"prepare": "yarn compile"
},
"license": "GPL-3.0-or-later"
}
8 changes: 4 additions & 4 deletions test/UniswapV2Factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ describe('UniswapV2Factory', () => {

it('createPair:gas', async () => {
const gasCost = await factory.estimate.createPair(...TEST_ADDRESSES)
expect(gasCost).to.eq(2513232)
expect(gasCost).to.eq(2512920)
})

it('setFeeTo', async () => {
await expect(factory.connect(other).setFeeTo(other.address)).to.be.reverted // UniswapV2: FORBIDDEN
await expect(factory.connect(other).setFeeTo(other.address)).to.be.revertedWith('UniswapV2: FORBIDDEN')
await factory.setFeeTo(wallet.address)
expect(await factory.feeTo()).to.eq(wallet.address)
})

it('setFeeToSetter', async () => {
await expect(factory.connect(other).setFeeToSetter(other.address)).to.be.reverted // UniswapV2: FORBIDDEN
await expect(factory.connect(other).setFeeToSetter(other.address)).to.be.revertedWith('UniswapV2: FORBIDDEN')
await factory.setFeeToSetter(other.address)
expect(await factory.feeToSetter()).to.eq(other.address)
await expect(factory.setFeeToSetter(wallet.address)).to.be.reverted // UniswapV2: FORBIDDEN
await expect(factory.setFeeToSetter(wallet.address)).to.be.revertedWith('UniswapV2: FORBIDDEN')
})
})
2 changes: 1 addition & 1 deletion test/UniswapV2Pair.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('UniswapV2Pair', () => {
await token1.transfer(pair.address, swapAmount)
await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1)
const gasCost = await pair.estimate.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides)
expect(gasCost).to.eq(79378)
expect(gasCost).to.eq(79136)
})

it('burn', async () => {
Expand Down
Loading

0 comments on commit 6cf43db

Please sign in to comment.