Skip to content

Commit c2360d0

Browse files
committed
Deployments
1 parent 52db7f5 commit c2360d0

31 files changed

+3188
-223
lines changed

diamond-contracts/deployments/0x1/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-contracts/deployments/0x1/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/deployments/0x2105/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-contracts/deployments/0x2105/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/deployments/0x250/ResaleFacet.json

+76-13
Large diffs are not rendered by default.

diamond-contracts/deployments/0x250/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/deployments/0x45c/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-contracts/deployments/0x45c/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/deployments/0x79a/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-contracts/deployments/0x79a/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/deployments/0x89/ResaleFacet.json

+85-22
Large diffs are not rendered by default.

diamond-contracts/deployments/0x89/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/deployments/0xaa36a7/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-contracts/deployments/0xaa36a7/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-contracts/hardhat.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
hardhat: {
4141
forking: {
4242
url: ETH_MAIN_RPC,
43-
blockNumber: 20467191
43+
blockNumber: 20777710
4444
}
4545
},
4646
// The rest of the blockchains are for deployment

diamond-contracts/test/diamonds.js

+28-12
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const initialRAIR20Supply = 10000;
1111
const priceToDeploy = 150;
1212

1313
// Expected deployment addresses
14-
const firstDeploymentAddress = '0x88Ec5C8192458d727177CcE65C5A0eB8A6C90F27';
15-
const secondDeploymentAddress = '0x06D6Fd5CAA224893341eEd17B5bad8CeA7D7d127';
14+
const firstDeploymentAddress = '0xE712663F8E29c911CcAe48C09D6Cbc29123aD156';
15+
const secondDeploymentAddress = '0xb37a8C9188B52040eABcbCAa15F25aE418fa5f11';
1616

1717
let usedSelectorsForFactory = {};
1818
let usedSelectorsForMarketplace = {};
@@ -1906,7 +1906,6 @@ describe("Diamonds", function () {
19061906
await expect(await (await extraERC20Instance.connect(addr1)).approve(factoryDiamondInstance.address, 2500))
19071907
.to.emit(extraERC20Instance, 'Approval')
19081908
.withArgs(addr1.address, factoryDiamondInstance.address, 2500);
1909-
console.info(await extraERC20Instance.balanceOf(addr1.address), await extraERC20Instance.balanceOf(owner.address));
19101909
});
19111910

19121911
it("Should take tokens after approval", async () => {
@@ -1941,7 +1940,7 @@ describe("Diamonds", function () {
19411940
it ("Should setup the time limit", async () => {
19421941
const pointsInstanceWithWithdraw = await ethers.getContractAt('PointsWithdraw', factoryDiamondInstance.address);
19431942
// A bit over 3 minutes limit before hash expires
1944-
await pointsInstanceWithWithdraw.setWithdrawTimeLimit(200);
1943+
await pointsInstanceWithWithdraw.setWithdrawTimeLimit(300);
19451944
});
19461945

19471946
it ("Shouldn't generate a signed message if amount is greater than balance", async () => {
@@ -1960,7 +1959,7 @@ describe("Diamonds", function () {
19601959
const pointsInstanceWithWithdraw = await ethers.getContractAt('PointsWithdraw', factoryDiamondInstance.address);
19611960
const withdrawValue = [
19621961
extraERC20Instance.address, // ERC20
1963-
1000, // Amount
1962+
1000, // Amount
19641963
];
19651964
const withdrawMessage = await pointsInstanceWithWithdraw.getWithdrawHash(
19661965
addr1.address,
@@ -2480,13 +2479,24 @@ describe("Diamonds", function () {
24802479
);
24812480
const result = await resaleInstance.getResaleOffer(0);
24822481
await expect(result.tokenPrice).to.equal(500000);
2482+
});
24832483

2484-
await expect(await resaleInstance.updateGasTokenOffer(0, 300000))
2485-
.to.emit(resaleInstance, 'TokenOfferUpdated')
2486-
.withArgs(
2487-
0,
2488-
300000
2489-
);
2484+
it ("Shouldn't update offers if user is not owner", async () => {
2485+
const resaleInstance = (await ethers.getContractAt(
2486+
'ResaleFacet',
2487+
marketDiamondInstance.address
2488+
)).connect(addr3);
2489+
await expect(resaleInstance.updateGasTokenOffer(1, 500000))
2490+
.to.be.revertedWith("Resale: Not the current owner of the token");
2491+
});
2492+
2493+
it ("Shouldn't delete offers if user is not owner", async () => {
2494+
const resaleInstance = (await ethers.getContractAt(
2495+
'ResaleFacet',
2496+
marketDiamondInstance.address
2497+
)).connect(addr3);
2498+
await expect(resaleInstance.deleteGasTokenOffer(1))
2499+
.to.be.revertedWith("Resale: Not the current owner of the token");
24902500
});
24912501

24922502
it ("Should delete offers", async () => {
@@ -2505,8 +2515,14 @@ describe("Diamonds", function () {
25052515
const resaleInstance = await ethers.getContractAt('ResaleFacet', marketDiamondInstance.address);
25062516
await expect(resaleInstance.purchaseGasTokenOffer(
25072517
0, // Offer Id
2508-
{value: 2000}
2518+
{value: 300000}
25092519
)).to.be.revertedWith("Resale: Insufficient funds!");
2520+
await expect(await resaleInstance.connect(addr3).updateGasTokenOffer(0, 300000))
2521+
.to.emit(resaleInstance, 'TokenOfferUpdated')
2522+
.withArgs(
2523+
0,
2524+
300000
2525+
);
25102526
});
25112527

25122528
it ("Should purchase resale offers (stored in the blockchain)", async () => {

diamond-manager/src/deployments/0x1/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-manager/src/deployments/0x1/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-manager/src/deployments/0x2105/ResaleFacet.json

+77-14
Large diffs are not rendered by default.

diamond-manager/src/deployments/0x2105/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

diamond-manager/src/deployments/0x250/ResaleFacet.json

+76-13
Large diffs are not rendered by default.

diamond-manager/src/deployments/0x250/solcInputs/e28d0114feab035ce27465409ff5f524.json

+69
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)