Skip to content
Closed
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
5b39d9d
deploy: xdeployed and verified payments on goerli
yomarion Jul 8, 2022
a8e030f
deploy: goerli contracts
romtref Jul 8, 2022
c0d1b74
Update index.ts
romtref Jul 8, 2022
0163f8c
wip: ETHConversionProxy
yomarion Jul 8, 2022
eb63055
refactor: squash unsigned commits
romtref Jul 11, 2022
853d9b6
feat: add goerli
romtref Jul 15, 2022
08f4efe
fix(smart-contracts): update batch fees (#873)
olivier7delf Jul 11, 2022
01b640a
feat: add cancel stream function (#884)
bertux Jul 12, 2022
d0390af
fixed ethFeeProxy subgraph goerli test
KolevDarko Jul 15, 2022
bbe2a4a
refactor: move goerli to the newest versions
romtref Jul 15, 2022
666b7f4
refactor: move goerli to the newest versions
romtref Jul 15, 2022
8e83c98
new escrow deployed on mainnet, rinkeby, goerli, matic and fuse
KolevDarko Jul 18, 2022
0bd6171
refactor: contract setup compression fix (#888)
KolevDarko Jul 28, 2022
f772e9f
feat: goerli storage (#890)
romtref Jul 28, 2022
e8f24d7
fix: modify smart contract address
romtref Jul 28, 2022
ac2f343
fix: ETHConversionProxy to EthConversionProxy
romtref Jul 28, 2022
110d298
fix: add MIT License
romtref Jul 28, 2022
2caf6f1
doc: modify command to create request (#880)
romtref Jul 28, 2022
d1b6003
deploy: goerli contracts
romtref Jul 8, 2022
b0f15ec
refactor: add goerli address contract
romtref Jul 11, 2022
d70ada0
-S
romtref Jul 12, 2022
756206b
-S
romtref Jul 11, 2022
f66a8cd
refactor: goerli tests
romtref Jul 12, 2022
41d883a
refactor: goerli contract address in tests
romtref Jul 12, 2022
64f70cb
refactor: goerli tests
romtref Jul 12, 2022
e7bca19
fixed ethFeeProxy subgraph goerli test
KolevDarko Jul 15, 2022
8df5c70
refactor: move goerli to the newest versions
romtref Jul 15, 2022
8cb36e0
refactor: move goerli to the newest versions
romtref Jul 15, 2022
c844097
new escrow deployed on mainnet, rinkeby, goerli, matic and fuse
KolevDarko Jul 18, 2022
7d038c0
refactor: contract setup compression fix (#888)
KolevDarko Jul 28, 2022
c46d591
fix: ETHConversionProxy to EthConversionProxy
romtref Jul 29, 2022
8aa6874
ETHConversionProxy to EthConversionProxy
romtref Jul 29, 2022
c50295d
refactor: keep 0.2.0 goerli version
romtref Jul 29, 2022
ef7ad8f
Merge branch 'master' into deploy/goerli-payments
romtref Jul 29, 2022
624a320
fix: EthConversionProxy to setupEth...
romtref Jul 29, 2022
0b1afee
Merge branch 'deploy/goerli-payments' of https://github.com/RequestNe…
romtref Jul 29, 2022
f107716
fix: EthConversionProxy to ETHConversion...
romtref Jul 29, 2022
42826d1
commented goerli in eth-input detector
KolevDarko Jul 30, 2022
35ce742
fixing eth-input-data goerli test
KolevDarko Jul 30, 2022
0dc4e86
fixed formatting
KolevDarko Jul 30, 2022
5a507df
removed goerli input data test
KolevDarko Jul 30, 2022
9fda90d
updated escrow test config
KolevDarko Jul 30, 2022
874d00b
fixed formatting
KolevDarko Jul 31, 2022
dca533a
fixed casing
KolevDarko Jul 31, 2022
edf224a
fixed amount
KolevDarko Jul 31, 2022
1553b7d
fix: escrow audit fix 2 (#878)
KolevDarko Jul 7, 2022
e2f11d8
deploy: xdeployed and verified payments on goerli
yomarion Jul 8, 2022
d74e957
deploy: goerli contracts
romtref Jul 8, 2022
e53849b
Update index.ts
romtref Jul 8, 2022
ae58bc8
wip: ETHConversionProxy
yomarion Jul 8, 2022
61b510c
refactor: squash unsigned commits
romtref Jul 11, 2022
23ef8ec
feat: add goerli
romtref Jul 15, 2022
a0af723
fix(smart-contracts): update batch fees (#873)
olivier7delf Jul 11, 2022
bfe2e9e
feat: Add cancel stream function (#884)
bertux Jul 12, 2022
7a8194c
fixed ethFeeProxy subgraph goerli test
KolevDarko Jul 15, 2022
bf0d578
refactor: move goerli to the newest versions
romtref Jul 15, 2022
1608de0
refactor: move goerli to the newest versions
romtref Jul 15, 2022
08717cc
new escrow deployed on mainnet, rinkeby, goerli, matic and fuse
KolevDarko Jul 18, 2022
e693ba1
refactor: contract setup compression fix (#888)
KolevDarko Jul 28, 2022
dc731e3
feat: goerli storage (#890)
romtref Jul 28, 2022
61f72a5
fix: modify smart contract address
romtref Jul 28, 2022
b5eb9fb
fix: ETHConversionProxy to EthConversionProxy
romtref Jul 28, 2022
1dcc857
fix: add MIT License
romtref Jul 28, 2022
a684a32
doc : modify command to create request (#880)
romtref Jul 28, 2022
ce2eeec
deploy: goerli contracts
romtref Jul 8, 2022
cd2e852
refactor: add goerli address contract
romtref Jul 11, 2022
5c2255d
-S
romtref Jul 12, 2022
6b77926
-S
romtref Jul 11, 2022
7bd57e5
refactor: goerli tests
romtref Jul 12, 2022
e3e067b
refactor: goerli contract address in tests
romtref Jul 12, 2022
9ef2a45
refactor: goerli tests
romtref Jul 12, 2022
5323513
fixed ethFeeProxy subgraph goerli test
KolevDarko Jul 15, 2022
07a34bb
refactor: move goerli to the newest versions
romtref Jul 15, 2022
17605d4
refactor: move goerli to the newest versions
romtref Jul 15, 2022
eb21df8
new escrow deployed on mainnet, rinkeby, goerli, matic and fuse
KolevDarko Jul 18, 2022
c70c173
refactor: contract setup compression fix (#888)
KolevDarko Jul 28, 2022
46d427d
fix: ETHConversionProxy to EthConversionProxy
romtref Jul 29, 2022
2e69920
ETHConversionProxy to EthConversionProxy
romtref Jul 29, 2022
cf5fdea
fix: EthConversionProxy to setupEth...
romtref Jul 29, 2022
d64f685
refactor: keep 0.2.0 goerli version
romtref Jul 29, 2022
414865f
refactor: contract setup compression fix (#888)
KolevDarko Jul 28, 2022
60e430a
fix: EthConversionProxy to ETHConversion...
romtref Jul 29, 2022
22519fe
commented goerli in eth-input detector
KolevDarko Jul 30, 2022
cf34428
fixing eth-input-data goerli test
KolevDarko Jul 30, 2022
5be827a
fixed formatting
KolevDarko Jul 30, 2022
80e413f
removed goerli input data test
KolevDarko Jul 30, 2022
8ac0f6f
updated escrow test config
KolevDarko Jul 30, 2022
20cb310
refactor: goerli test
romtref Jul 31, 2022
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
8 changes: 8 additions & 0 deletions packages/currency/src/aggregators/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"0xba62bcfcaafc6622853cca2be6ac7d845bc0f2dc": {
"0x775eb53d00dd0acd3ec1696472105d579b9b386b": 1
},
"0x775eb53d00dd0acd3ec1696472105d579b9b386b": {
"0xba62bcfcaafc6622853cca2be6ac7d845bc0f2dc": 1
}
}
17 changes: 17 additions & 0 deletions packages/currency/src/erc20/networks/goerli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { TokenMap } from './types';

// List of the supported goerli ERC20 tokens
export const supportedGoerliERC20: TokenMap = {
// Request Test token, used for testing on goerli.
'0x7af963cF6D228E564e2A0aA0DdBF06210B38615D': {
decimals: 18,
name: 'Goerli Test Token',
symbol: 'TST',
},
// Faucet Token on goerli network. Easy to use on tests.
'0xBA62BCfcAaFc6622853cca2BE6Ac7d845BC0f2Dc': {
decimals: 18,
name: 'Faucet Token',
symbol: 'FAU-goerli',
},
};
2 changes: 1 addition & 1 deletion packages/payment-detection/src/erc20/address-based.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BalanceError } from '../balance-error';
import Erc20InfoRetriever from './address-based-info-retriever';

import { PaymentDetectorBase } from '../payment-detector-base';
const supportedNetworks = ['mainnet', 'rinkeby', 'private'];
const supportedNetworks = ['mainnet', 'rinkeby', 'goerli', 'private'];

/**
* Handle payment networks with ERC20 based address extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const mockAdvancedLogic: AdvancedLogicTypes.IAdvancedLogic = {
},
extensions: {
anyToErc20Proxy: {
supportedNetworks: ['mainnet', 'rinkeby', 'private'],
supportedNetworks: ['mainnet', 'rinkeby', 'goerli', 'private'],
createAddPaymentAddressAction,
createAddRefundAddressAction,
createCreationAction,
Expand All @@ -56,7 +56,7 @@ describe('api/any/conversion-fee-proxy-contract', () => {
jest.clearAllMocks();
});

it('can createExtensionsDataForCreation', async () => {
it('can createExtensionsDataForCreation (Rinkeby)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
Expand All @@ -77,7 +77,28 @@ describe('api/any/conversion-fee-proxy-contract', () => {
});
});

it('can createExtensionsDataForCreation with fee amount and address', async () => {
it('can createExtensionsDataForCreation (Goerli)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'goerli',
maxRateTimespan: 1000,
});

expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: undefined,
feeAmount: undefined,
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'goerli',
maxRateTimespan: 1000,
});
});

it('can createExtensionsDataForCreation with fee amount and address (Rinkeby)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
feeAddress: 'fee address',
feeAmount: '2000',
Expand All @@ -98,6 +119,27 @@ describe('api/any/conversion-fee-proxy-contract', () => {
});
});

it('can createExtensionsDataForCreation with fee amount and address (Goerli)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
feeAddress: 'fee address',
feeAmount: '2000',
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'goerli',
});

expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: 'fee address',
feeAmount: '2000',
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'goerli',
});
});

it('can createExtensionsDataForCreation without salt', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
paymentAddress: 'ethereum address',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('api/erc20/address-based', () => {
error: {
code: PaymentTypes.BALANCE_ERROR_CODE.NETWORK_NOT_SUPPORTED,
message:
'Payment network wrong not supported by ERC20 payment detection. Supported networks: mainnet, rinkeby, private',
'Payment network wrong not supported by ERC20 payment detection. Supported networks: mainnet, rinkeby, goerli, private',
},
events: [],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,28 @@ describe('api/erc20/escrow-info-retriever', () => {
expect(escrowChainData.isFrozen).toEqual(true);
});
});

describe('test on goerli', () => {
let infoRetriever: EscrowERC20InfoRetriever;
beforeAll(() => {
infoRetriever = new EscrowERC20InfoRetriever(
paymentReferenceMock,
'0xd2777001fD7D89331D8E87eC439f78079179322b',
0,
'',
'',
'goerli',
);
});
it('should get escrow chain data', async () => {
const escrowChainData = await infoRetriever.getEscrowRequestMapping();
// Not yet ERC777 token on goerli
expect(escrowChainData.payer).toEqual('0xffb1D8EfeCAA177DeEf1cD1AB202E5E9f6a84db4');
expect(escrowChainData.amount.toString()).toEqual('1');
expect(escrowChainData.unlockDate.toString()).toEqual('0');
expect(escrowChainData.emergencyClaimDate.toString()).toEqual('0');
expect(escrowChainData.emergencyState).toEqual(false);
expect(escrowChainData.isFrozen).toEqual(false);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const mockAdvancedLogic: AdvancedLogicTypes.IAdvancedLogic = {
},
extensions: {
feeProxyContractErc20: {
supportedNetworks: ['mainnet', 'private', 'rinkeby'],
supportedNetworks: ['mainnet', 'private', 'rinkeby', 'goerli'],
createAddPaymentAddressAction,
createAddRefundAddressAction,
createCreationAction,
Expand Down Expand Up @@ -283,7 +283,7 @@ describe('api/erc20/fee-proxy-contract', () => {
).toBe('7');
});

it('should have gasFee & gasUsed in the payment eventl', async () => {
it('should have gasFee & gasUsed in the payment event', async () => {
const mockRequest: RequestLogicTypes.IRequest = {
creator: { type: IdentityTypes.TYPE.ETHEREUM_ADDRESS, value: '0x2' },
currency: {
Expand Down
4 changes: 2 additions & 2 deletions packages/payment-detection/test/erc20/proxy-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const mockAdvancedLogic: AdvancedLogicTypes.IAdvancedLogic = {
},
extensions: {
proxyContractErc20: {
supportedNetworks: ['mainnet', 'rinkeby'],
supportedNetworks: ['mainnet', 'rinkeby', 'goerli'],
createAddPaymentAddressAction,
createAddRefundAddressAction,
createCreationAction,
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('api/erc20/proxy-contract', () => {
error: {
code: PaymentTypes.BALANCE_ERROR_CODE.NETWORK_NOT_SUPPORTED,
message:
'Payment network WRONG not supported by pn-erc20-proxy-contract payment detection. Supported networks: mainnet, rinkeby',
'Payment network WRONG not supported by pn-erc20-proxy-contract payment detection. Supported networks: mainnet, rinkeby, goerli',
},
events: [],
});
Expand Down
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', async () => {
it('should get payment event from ethFeeConversionProxy via subgraph (Rinkeby)', async () => {
const paymentData = {
reference: '0x6c93723bc5f82e6fbb2ea994bf0fb572fa19f7a2a3146065e21752b95668efe5',
txHash: '0x2f7b4752aa259166c038cd9073056c5979760cf0eea55d093fca2095c229313b',
Expand Down Expand Up @@ -89,4 +89,90 @@ 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: '0x29a55b7f978a902275746f6eb930abf608dc77c0592fce9cf6c326128fcf7493',
from: '0xBc9643B7Bd7c8621F4a68280433796484b9E525d',
to: '0x5000ee9fb9c96a2a09d8efb695ac21d6c429ff11',
network: 'goerli',
salt: '0ee84db293a752c6',
amount: '600000000000000',
requestId: '0188791633ff0ec72a7dbdefb886d2db6cccfa98287320839c2f173c7a4e3ce7e1',
block: 7230236,
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('600000000000000');
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);
});

// doesn't work because chainlink doesn't have oracles on goerli
it.skip('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);
});
});
});
2 changes: 1 addition & 1 deletion packages/payment-detection/test/erc777/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const mockFlows = [
},
{
transactionHash: '0xe472ca1b52751b058fbdaeaffebd98c0cc43b45aa31794b3eb06834ede19f7be',
blockNumber: '9945543',
blockNumber: 9945543,
timestamp: '1641495767',
sender: '0x9c040e2d6fd83a8b35069aa7154b69674961e0f7',
flowRate: '0',
Expand Down
Loading