Skip to content

Commit

Permalink
parent 58402f0
Browse files Browse the repository at this point in the history
author olivier7delf <55892112+olivier7delf@users.noreply.github.com> 1657529886 +0200
committer Romain TREFAULT <romtref@gmail.com> 1659338957 +0200
gpgsig -----BEGIN PGP SIGNATURE-----

 iQIzBAABCAAdFiEESJbe1R3hzb/g0Lx8X0oYuBcZna0FAmLngM0ACgkQX0oYuBcZ
 na3FSg/9FqPZs8oH38kbtA+HMgUmSYkloTTKefY80dADoVhQc2XrO59MchQmxx91
 GlCl6bcrSWpmjTojTo653V3aLFyRfBCltzEE16sM2VYmIgd+lXg4fnK60yB9Xq03
 f0NYtd6R7F48pINtOepRZ8kieFRHxcBbE1StV+pZTRJeHQEsbudbtio3rsfkGVnk
 S/OwwzsQFfJXYDWp4dj6Suz6fy4kgO5e3ZkF0VkKXIMKBEuRiUTf/QWK0nus968C
 phdtXOzPy1gttVFtY+luA6NboH27jh0k/eVYaab8JkFY42c/kPrxh+Ou6LeKh/Mr
 G7MB55COmHmt+QEn3o1DFqcaSe9UDuuJVgyG3gb81QxFedc0wsTE4T4WvnLjdume
 RfBxQ/VbXAuYw7xEZ0vPvKDtQkDoWwXhvsniluplpLeHnYKYKLe3yG/pi9z3xIV4
 G/Z+kMXCKM8lAy+pKRSHzv1tMHg02ERLGoyGhGfC+FUkkGDasznKnaxBYqOYHxsy
 aoaZxec5U7Vrqkz20Exg2sHlyieJIJn3Oh+Sk+ouOINqbArVFGLb379JAi9aEsjl
 MKULpC8opOPE3l9PcsDCh9oHlKW+i1pRcVpya/OiRZUy+sYdNb4sBDsuufJAUjyL
 3b1MRecrh3ZNo0wPLuxypg1x01/Y0JDtaX1Pw0KLXCHLDd6noD4=
 =vfDF
 -----END PGP SIGNATURE-----

parent 58402f0
author olivier7delf <55892112+olivier7delf@users.noreply.github.com> 1657529886 +0200
committer Romain TREFAULT <romtref@gmail.com> 1659338942 +0200
gpgsig -----BEGIN PGP SIGNATURE-----

 iQIzBAABCAAdFiEESJbe1R3hzb/g0Lx8X0oYuBcZna0FAmLngL4ACgkQX0oYuBcZ
 na1YNBAAzkAdo+3oZuMuzESNXIUumoLj8iPhAziioVDisKiCUSk8dLkUZ+Dm8nt4
 AznGw2wypVLxgk9LMsIEsBHRZvFkC09PNGI0tl1lYgwTNpJnERCxnisVy4P2mTmk
 vx14DId1xJg6h7B8TfIpEuHJ9PgoVH4CMo0D4r7dkc37ucFqCqqvjFy0Q74BWrAt
 QIiRtsB4I7tcj+dOMfIYv2VwuHSJiKAEU9zejkKE7opnVvsCp011WaqDCi38MSPS
 4clkfj426nrH3iVHFe6X+6sAmhL4YqkGmVSdFcvPpoIfFreaAkN/FHuPTAfXGx3y
 ZK+x5CVW7yWMKERroD+qly2FMEWIcSonOFLoASrcpyxEOPNCyfChFO4HBfPTu7ms
 knA0pTWSGjE8K9UI/zf4jh5bdlDO/scUJdSXO8Z25nCp91kACmSIZI56mME86RL5
 kZxuBxD9GmtKgZ9xeSaQRoxGjE643xC9pZ2TDReZgQedhIcDy+Bff20XnBjsR8WW
 Mxk+dzzNWWgZPCeNkX7S1MBUUItFKKN/feSc8Ey9ZUUJbk66SyGrnbj5bLPfEaND
 oQy9Cu94P0J5ZvRn3GUo8solUZ9lpW6mO4JNomyDNkwiO2DiIZ40DvWYbiCjvjVS
 wohC5M8OrhVtiWjfcnYrcQvAkgB1eiLPUzc0Q9VYo4daiNhhqPo=
 =ercG
 -----END PGP SIGNATURE-----

parent 58402f0
author olivier7delf <55892112+olivier7delf@users.noreply.github.com> 1657529886 +0200
committer Romain TREFAULT <romtref@gmail.com> 1659338203 +0200
gpgsig -----BEGIN PGP SIGNATURE-----

 iQIzBAABCAAdFiEESJbe1R3hzb/g0Lx8X0oYuBcZna0FAmLnfdsACgkQX0oYuBcZ
 na3DHQ//RfNwAXsNwVRFdE61rTKHGw2sHoyNwxjT9tsthH2AoYMPwHZddmaX9uAj
 LQ5mnfSVEtIhnu3CQKLdtxpCFX7+tUpdNSKeaLYtgeKxHM2ZggDJRBDl9vZPK/A7
 kYSdlySa+c7BDVhw8X8GqCodm2O+DUv/ZJBWNZkXB9mg1ZQoudDrZk7o07A1vQBN
 d7MJ6hIrCDvHaur/cHmHB1TUuI9YA1IILQ/DC/KbuujN4QYhl1fvbPVL4muq+vHC
 gv6UUEI1pRG8mRRypdtTebzYZxOdxz5ezRNiAgfS44h+q44PIfL7nJuRwZJRg6Dm
 n4vYR71LPMSiRbSNXG+EQ4mPWdpnF/C/eLGfY/otwlNyy7KQFA27R2dJ2lpPYZOz
 N3MNNudGEG1vXbwjMgEYnY6jhEii30KY80ti5wWiF7szDHgk2JXy+l6rhaMR/KQ8
 6qL0dDFYoiOH/3ggP3HSowftzr/xJB92So5e5LEi7neLpolHNgC4sIYu/oYZK9te
 Q4LpL9h35uER+sh1YhqfU9o2y2YV+Mv4ZbJ9VFKQG6/FWSO1hLnwAxzroKUVCvhm
 5Y9fwTsrisiW9F+jjUutL7tqUROZ4F4/0jrHhrKY8FM0GqEKxyI9wF4ZeOG9EtcH
 qsxFAymOUGUlQYYKCALGasJid80ldg/X4abg+0Gemc40w9f/5Ls=
 =bAV2
 -----END PGP SIGNATURE-----

fix(smart-contracts): update batch fees (#873)

update batch fees from 1% to .3%

fixed ethFeeProxy subgraph goerli test

refactor: move goerli to the newest versions

refactor: move goerli to the newest versions

new escrow deployed on mainnet, rinkeby, goerli, matic and fuse

refactor: contract setup compression fix (#888)

feat: goerli storage (#890)

feat: squash commits goerli storage

fix: modify smart contract address

fix: ETHConversionProxy to EthConversionProxy

fix: add MIT License

doc : modify command to create request (#880)

* refactor: command to create request

* fix: escrow audit fix 2 (#878)

* fix(smart-contracts): update batch fees (#873)

update batch fees from 1% to .3%

* feat: add cancel stream function (#884)

* refactor: contract setup compression fix (#888)

* fix: escrow audit fix 2 (#878)

* fix(smart-contracts): update batch fees (#873)

update batch fees from 1% to .3%

* feat: add cancel stream function (#884)

* refactor: contract setup compression fix (#888)

* feat: goerli storage (#890)

feat: squash commits goerli storage

* fix: delete ETHConversionProxy

Co-authored-by: Darko Kolev <kolevdarko@gmail.com>
Co-authored-by: olivier7delf <55892112+olivier7delf@users.noreply.github.com>
Co-authored-by: Bertrand Juglas <b@juglas.name>

deploy: goerli contracts

refactor: add goerli address contract

-S

refactor: add goerli tests

-S

feat: add goerli payment-detection tests

refactor: goerli tests

refactor: goerli contract address in tests

refactor: goerli tests

fixed ethFeeProxy subgraph goerli test

refactor: move goerli to the newest versions

refactor: move goerli to the newest versions

new escrow deployed on mainnet, rinkeby, goerli, matic and fuse

refactor: contract setup compression fix (#888)

fix: ETHConversionProxy to EthConversionProxy

ETHConversionProxy to EthConversionProxy

fix: EthConversionProxy to setupEth...

refactor: keep 0.2.0 goerli version

refactor: contract setup compression fix (#888)

fix: EthConversionProxy to ETHConversion...

commented goerli in eth-input detector

fixing eth-input-data goerli test

fixed formatting

removed goerli input data test

updated escrow test config

deploy: goerli contracts

Update index.ts

wip: ETHConversionProxy

refactor: squash unsigned commits

-S

refactor: add goerli tests

refactor: add goerli tests

refactor: add goerli tests

feat: add goerli support in currency

-S

feat: add goerli payment-detection tests

refactor: setups.ts

refactor: goerli tests

refactor: goerli contract address in tests

refactor: goerli tests

refactor: rename ETHConversionProxy to EthConversionProxy

feat: add goerli

fix(smart-contracts): update batch fees (#873)

update batch fees from 1% to .3%

feat: add cancel stream function (#884)

fixed ethFeeProxy subgraph goerli test

refactor: move goerli to the newest versions

refactor: move goerli to the newest versions

new escrow deployed on mainnet, rinkeby, goerli, matic and fuse

feat: goerli storage (#890)

feat: squash commits goerli storage

fix: modify smart contract address

fix: ETHConversionProxy to EthConversionProxy

fix: add MIT License

doc: modify command to create request (#880)

* refactor: command to create request

* fix: escrow audit fix 2 (#878)

* fix(smart-contracts): update batch fees (#873)

update batch fees from 1% to .3%

* feat: add cancel stream function (#884)

* refactor: contract setup compression fix (#888)

* fix: escrow audit fix 2 (#878)

* fix(smart-contracts): update batch fees (#873)

update batch fees from 1% to .3%

* feat: add cancel stream function (#884)

* refactor: contract setup compression fix (#888)

* feat: goerli storage (#890)

feat: squash commits goerli storage

* fix: delete ETHConversionProxy

Co-authored-by: Darko Kolev <kolevdarko@gmail.com>
Co-authored-by: olivier7delf <55892112+olivier7delf@users.noreply.github.com>
Co-authored-by: Bertrand Juglas <b@juglas.name>

deploy: goerli contracts

refactor: add goerli address contract

-S

refactor: add goerli tests

-S

feat: add goerli payment-detection tests

refactor: goerli tests

refactor: goerli tests

refactor: move goerli to the newest versions

refactor: move goerli to the newest versions

new escrow deployed on mainnet, rinkeby, goerli, matic and fuse

refactor: contract setup compression fix (#888)

fix: ETHConversionProxy to EthConversionProxy

refactor: keep 0.2.0 goerli version

fix: EthConversionProxy to ETHConversion...

commented goerli in eth-input detector

fixing eth-input-data goerli test

fixed formatting

removed goerli input data test

updated escrow test config

fixed formatting
  • Loading branch information
olivier7delf authored and rom1trt committed Aug 1, 2022
1 parent 9a2b56b commit b58463e
Show file tree
Hide file tree
Showing 21 changed files with 192 additions and 267 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,4 @@ describe('api/erc20/escrow-info-retriever', () => {
expect(escrowChainData.isFrozen).toEqual(true);
});
});

describe('test on goerli', () => {
let infoRetriever: EscrowERC20InfoRetriever;
beforeAll(() => {
infoRetriever = new EscrowERC20InfoRetriever(
paymentReferenceMock,
'0x8230e703B1c4467A4543422b2cC3284133B9AB5e',
0,
'',
'',
'goerli',
);
});
it('should get escrow chain data', async () => {
const escrowChainData = await infoRetriever.getEscrowRequestMapping();
// Not yet ERC777 token on goerli
// expect(escrowChainData.tokenAddress).toEqual('0x745861AeD1EEe363b4AaA5F1994Be40b1e05Ff90');
expect(escrowChainData.payee).toEqual('0xB9B7e0cb2EDF5Ea031C8B297A5A1Fa20379b6A0a');
expect(escrowChainData.payer).toEqual('0x0c051a1f4E209b00c8E7C00AD0ce79B3630a7401');
expect(escrowChainData.amount.toString()).toEqual('123000000000000000000');
expect(escrowChainData.unlockDate.toString()).toEqual('1670505020');
expect(escrowChainData.emergencyClaimDate.toString()).toEqual('0');
expect(escrowChainData.emergencyState).toEqual(false);
expect(escrowChainData.isFrozen).toEqual(true);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('api/erc20/thegraph-info-retriever', () => {
expect(transferEvents[0].parameters?.feeAmount).toEqual(paymentData.feeAmount);
});

it('should get payment event from ethFeeConversionProxy via subgraph (Rinkeby)', async () => {
it('should get payment event from ethFeeConversionProxy via subgraph', async () => {
const paymentData = {
reference: '0x6c93723bc5f82e6fbb2ea994bf0fb572fa19f7a2a3146065e21752b95668efe5',
txHash: '0x2f7b4752aa259166c038cd9073056c5979760cf0eea55d093fca2095c229313b',
Expand Down Expand Up @@ -89,89 +89,4 @@ describe('api/erc20/thegraph-info-retriever', () => {
expect(transferEvents[0].parameters?.block).toEqual(paymentData.block);
});
});

describe('on goerli', () => {
const GOERLI_ETH_FEE_PROXY_CONTRACT = '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687';
const GOERLI_ETH_CONVERSION_PROXY_CONTRACT = '0xED250D9219EB93098Bb67aEbc992963172B9c8DA';

it('should get payment event from ethFeeProxy via subgraph', async () => {
const paymentData = {
reference: '0x6c93723bc5f82e6fbb2ea994bf0fb572fa19f7a2a3146065e21752b95668efe5',
txHash: '0x3e2d6cc2534b1d340ba2954f34e6cc819d6da64ff76863ea89c6d34b15d13c97',
from: '0x186e7fe6c34ea0eca7f9c2fd29651fc0443e3f29',
to: '0x5000ee9fb9c96a2a09d8efb695ac21d6c429ff11',
network: 'goerli',
salt: '0ee84db293a752c6',
amount: '30000000000000',
requestId: '0188791633ff0ec72a7dbdefb886d2db6cccfa98287320839c2f173c7a4e3ce7e1',
block: 9606098,
feeAddress: '0x5000EE9FB9c96A2A09D8efB695aC21D6C429fF11',
feeAmount: '0',
};
const paymentReference = PaymentReferenceCalculator.calculate(
paymentData.requestId,
paymentData.salt,
paymentData.to,
);
const onChainReference = utils.keccak256(`0x${paymentReference}`);
expect(onChainReference).toEqual(paymentData.reference);

const graphRetriever = new TheGraphInfoRetriever(
paymentReference,
GOERLI_ETH_FEE_PROXY_CONTRACT,
null,
paymentData.to,
PaymentTypes.EVENTS_NAMES.PAYMENT,
paymentData.network,
);
const allNetworkEvents = await graphRetriever.getTransferEvents();
const transferEvents = allNetworkEvents.paymentEvents;
// expect(transferEvents).toHaveLength(1);
expect(transferEvents[0].amount).toEqual('30000000000000');
expect(transferEvents[0].name).toEqual('payment');
expect(transferEvents[0].parameters?.to).toEqual(paymentData.to);
expect(transferEvents[0].parameters?.txHash).toEqual(paymentData.txHash);
expect(transferEvents[0].parameters?.block).toEqual(paymentData.block);
expect(transferEvents[0].parameters?.feeAddress).toEqual(paymentData.feeAddress);
expect(transferEvents[0].parameters?.feeAmount).toEqual(paymentData.feeAmount);
});

it('should get payment event from ethFeeConversionProxy via subgraph', async () => {
const paymentData = {
reference: '0x6c93723bc5f82e6fbb2ea994bf0fb572fa19f7a2a3146065e21752b95668efe5',
txHash: '0x2f7b4752aa259166c038cd9073056c5979760cf0eea55d093fca2095c229313b',
from: '0x186e7fe6c34ea0eca7f9c2fd29651fc0443e3f29',
to: '0x5000ee9fb9c96a2a09d8efb695ac21d6c429ff11',
network: 'goerli',
salt: '0ee84db293a752c6',
amount: '7000',
block: 9610470,
requestId: '0188791633ff0ec72a7dbdefb886d2db6cccfa98287320839c2f173c7a4e3ce7e1',
};

const shortReference = PaymentReferenceCalculator.calculate(
paymentData.requestId,
paymentData.salt,
paymentData.to,
);
const onChainReference = utils.keccak256(`0x${shortReference}`);
expect(onChainReference).toEqual(paymentData.reference);

const graphRetriever = new TheGraphInfoRetriever(
shortReference,
GOERLI_ETH_CONVERSION_PROXY_CONTRACT,
null,
paymentData.to,
PaymentTypes.EVENTS_NAMES.PAYMENT,
paymentData.network,
);
const allNetworkEvents = await graphRetriever.getTransferEvents();
const transferEvents = allNetworkEvents.paymentEvents;
// expect(transferEvents).toHaveLength(1);
expect(transferEvents[0].amount).toEqual(paymentData.amount);
expect(transferEvents[0].parameters?.to).toEqual(paymentData.to);
expect(transferEvents[0].parameters?.txHash).toEqual(paymentData.txHash);
expect(transferEvents[0].parameters?.block).toEqual(paymentData.block);
});
});
});
4 changes: 2 additions & 2 deletions packages/payment-detection/test/eth/info-retriever.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ describe('api/eth/info-retriever', () => {
});

describe('Multichain', () => {
// TODO temporary disable xDAI, CELO and Sokol
// TODO temporary disable xDAI, CELO Sokol, and Goerli
// FIXME: API-based checks should run nightly and be mocked for CI
[
'mainnet',
'rinkeby',
'goerli',
// 'goerli',
// 'xdai',
// 'sokol',
'fuse',
Expand Down
80 changes: 0 additions & 80 deletions packages/payment-detection/test/eth/input-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,84 +245,4 @@ describe('api/eth/input-data', () => {
expect(balance.events[0].amount).toBe('80000000000000000');
expect(typeof balance.events[0].timestamp).toBe('number');
});

it('can get balance from goerli subgraph', async () => {
const goerliRequest = {
currency: {
network: 'goerli',
type: RequestLogicTypes.CURRENCY.ETH,
value: 'ETH-goerli',
},
expectedAmount: '80000000000000000',
payee: {
type: 'ethereumAddress',
value: '0x1D274D164937465B7A7259347AD3f1aaEEEaC8e1',
},
payer: {
type: 'ethereumAddress',
value: '0x5e7D193321A4CCB091038d01755a10d143cb2Dc8',
},
timestamp: 1620207049,
extensionsData: [
{
action: 'create',
id: 'pn-eth-input-data',
parameters: {
paymentAddress: '0x8400b234e7B113686bD584af9b1041E5a233E754',
salt: '2334c5f6691a9131',
},
version: '0.2.0',
},
],
extensions: {
'pn-eth-input-data': {
events: [
{
name: 'create',
parameters: {
paymentAddress: '0x8400b234e7B113686bD584af9b1041E5a233E754',
salt: '2334c5f6691a9131',
},
timestamp: 1620207051,
},
],
id: 'pn-eth-input-data',
type: 'payment-network',
values: {
paymentAddress: '0x8400b234e7B113686bD584af9b1041E5a233E754',
salt: '2334c5f6691a9131',
},
version: '0.2.0',
},
},
requestId: '0110e7eaba7a3ff2e2239081497308db70e4c66362100d747903ffa5c83d290d5d',
version: '2.0.3',
events: [
{
actionSigner: {
type: 'ethereumAddress',
value: '0x1D274D164937465B7A7259347AD3f1aaEEEaC8e1',
},
name: 'create',
parameters: {
expectedAmount: '80000000000000000',
extensionsDataLength: 2,
isSignedRequest: false,
},
timestamp: 1620207051,
},
],
state: 'created',
creator: {
type: 'ethereumAddress',
value: '0x1D274D164937465B7A7259347AD3f1aaEEEaC8e1',
},
};
const balance = await ethInputData.getBalance(goerliRequest as RequestLogicTypes.IRequest);
expect(balance.balance).toBe('80000000000000000');
expect(balance.events).toHaveLength(1);
expect(balance.events[0].name).toBe(PaymentTypes.EVENTS_NAMES.PAYMENT);
expect(balance.events[0].amount).toBe('80000000000000000');
expect(typeof balance.events[0].timestamp).toBe('number');
});
});
3 changes: 1 addition & 2 deletions packages/smart-contracts/scripts-create2/constructor-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ export const getConstructorArgs = (contract: string, network?: string): string[]
getAdminWalletAddress(contract),
];
}
case 'EthConversionProxy': {
case 'ETHConversionProxy': {
return [
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
'0x39e19aa5b69466dfdc313c7cda37cb2a599015cd',
];
// TODO setupEthConversionProxy
}
case 'ERC20SwapToConversion': {
return [getAdminWalletAddress(contract)];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { updateChainlinkConversionPath, updatePaymentErc20FeeProxy } from './adm
* @param contractAddress address of the BatchPayments Proxy
* @param hre Hardhat runtime environment
*/
export const setupEthConversionProxy = async (
export const setupETHConversionProxy = async (
contractAddress: string,
hre: HardhatRuntimeEnvironmentExtended,
): Promise<void> => {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HardhatRuntimeEnvironmentExtended } from '../types';
import { setupEthConversionProxy } from './setupEthConversionProxy';
import { setupETHConversionProxy } from './setupETHConversionProxy';
import { setupBatchPayments } from './setupBatchPayments';
import { setupERC20SwapToConversion } from './setupERC20SwapToConversion';

/**
* Updates the values of either BatchPayments, EthConversionProxy, or ERC20SwapToConversion contract, if needed
* Updates the values of either BatchPayments, ETHConversionProxy, or ERC20SwapToConversion contract, if needed
* @param contractAddress address of the proxy
* @param hre Hardhat runtime environment
* @param contractName name of the contract
Expand All @@ -15,8 +15,8 @@ export const setupContract = async (
contractName: string,
): Promise<void> => {
switch (contractName) {
case 'EthConversionProxy': {
await setupEthConversionProxy(contractAddress, hre);
case 'ETHConversionProxy': {
await setupETHConversionProxy(contractAddress, hre);
break;
}
case 'ERC20SwapToConversion': {
Expand Down
Loading

0 comments on commit b58463e

Please sign in to comment.