Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
01a0afe
advanced-logic and payment-detection
yomarion Mar 19, 2023
0dfe034
fix import
yomarion Mar 19, 2023
c671f5d
chore: replaced rinkeby with matic for TheGraph codegen
yomarion Mar 19, 2023
8af51c7
added payment-detection test for balance
yomarion Mar 19, 2023
5288331
fix: thegraph codegen issues with superfluid
yomarion Mar 19, 2023
f8a60fd
Merge remote-tracking branch 'origin/master' into feat/erc20-fee-prox…
yomarion Mar 19, 2023
c22485c
fix: chain utils
yomarion Mar 19, 2023
b77d304
fix deleted file
yomarion Mar 19, 2023
7fe103b
fix artifact and tenderly related types
yomarion Mar 20, 2023
957e3c6
fix: Utils.isSameNetwork and test
yomarion Mar 20, 2023
cd5baa1
fix: payment-detection near versionMap
yomarion Mar 20, 2023
7092478
dirty-wip before inheriting the abstract class
yomarion Mar 21, 2023
411dd1e
working tests with ERC20NearFeeProxy detector
yomarion Mar 21, 2023
37c0e47
tests running with standard retriever design
yomarion Mar 21, 2023
9d78781
standard info retriever for native token detections
yomarion Mar 22, 2023
dc3fcca
minor type fix
yomarion Mar 22, 2023
e3ebcde
got rid of ERC20NearFeeProxy
yomarion Mar 22, 2023
aeb51d3
fix prettier
yomarion Mar 22, 2023
5454cd4
fix prettier
yomarion Mar 22, 2023
1a30b10
prettier nycrc files
yomarion Mar 22, 2023
4a54df9
fix: mock types
yomarion Mar 22, 2023
6e2b501
fix: wrong mocked advanced-logic types
yomarion Mar 22, 2023
83531e0
minor test fix
yomarion Mar 22, 2023
d1fd986
chore: reduce irrelevant strong typing in tests
yomarion Mar 23, 2023
e89e7de
chore: improve type details in payment detector
yomarion Mar 23, 2023
5a6b0ba
Merge branch 'master' into feat/erc20-fee-proxy-on-near
yomarion Mar 24, 2023
b6b39e9
Merge remote-tracking branch 'origin/master' into feat/erc20-fee-prox…
yomarion Mar 24, 2023
2e45994
fix: merge details
yomarion Mar 26, 2023
ebfe888
Strongly typing NearChainName 1/n
yomarion Mar 26, 2023
d4add72
Strongly typing NearChainName 2/n
yomarion Mar 26, 2023
db7f5a8
fix: test unit test not unit-testable
yomarion Mar 27, 2023
66fd5ae
Enforce TGetSubGraphClient usage
yomarion Mar 27, 2023
3dd4d96
tiny type fix
yomarion Mar 27, 2023
b2c542e
Merge remote-tracking branch 'origin/master' into feat/erc20-fee-prox…
yomarion Mar 29, 2023
c71835e
fixes Alex' feedback
yomarion Mar 30, 2023
87a1207
reset yarn.lock
yomarion Mar 30, 2023
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
Prev Previous commit
Next Next commit
fix artifact and tenderly related types
  • Loading branch information
yomarion committed Mar 20, 2023
commit 7fe103b54d0dd5d4428780a3ff380e1cfcc0d3aa
34 changes: 20 additions & 14 deletions packages/smart-contracts/scripts-create2/tenderly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,26 @@ export const tenderlyImportAll = async (hre: HardhatRuntimeEnvironmentExtended):
const deployments = artifact.getAllAddressesFromAllNetworks();
for (const deployment of deployments) {
const { networkName, address, version } = deployment;
if (!supportedTenderlyChains.includes(networkName)) continue;
const chainId = EvmChains.getChainId(networkName);
const contract: TenderlyContract = {
address,
chainId,
};
const contractId = getTenderlyContractId(contract);
contracts[contractId] = {
name: capitalizeFirstLetter(artifactName.replace(/Artifact/i, '')),
...contract,
};
versions[version] ??= new Set();
versions[version].add(contractId);
(EvmChains.isTestnet(networkName) ? testnetContracts : mainnetContracts).add(contractId);
try {
EvmChains.assertChainSupported(networkName);

if (!supportedTenderlyChains.includes(networkName)) continue;
const chainId = EvmChains.getChainId(networkName);
const contract: TenderlyContract = {
address,
chainId,
};
const contractId = getTenderlyContractId(contract);
contracts[contractId] = {
name: capitalizeFirstLetter(artifactName.replace(/Artifact/i, '')),
...contract,
};
versions[version] ??= new Set();
versions[version].add(contractId);
(EvmChains.isTestnet(networkName) ? testnetContracts : mainnetContracts).add(contractId);
} catch {
continue;
}
}
}
console.log(`> Retrieved ${Object.keys(contracts).length} contracts from protocol artifacts`);
Expand Down
14 changes: 6 additions & 8 deletions packages/smart-contracts/src/lib/ContractArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ export type ArtifactNetworkInfo = {
};

/** Deployment information and ABI per network */
export type ArtifactDeploymentInfo<
TNetwork extends CurrencyTypes.EvmChainName = CurrencyTypes.EvmChainName,
> = {
export type ArtifactDeploymentInfo<TNetwork extends CurrencyTypes.VMChainName> = {
abi: JsonFragment[];
deployment: Partial<Record<TNetwork, ArtifactNetworkInfo>>;
};

/** Deployment information and ABI per version and network */
export type ArtifactInfo<
TVersion extends string = string,
TNetwork extends CurrencyTypes.EvmChainName = CurrencyTypes.EvmChainName,
TNetwork extends CurrencyTypes.VMChainName = CurrencyTypes.VMChainName,
> = Record<TVersion, ArtifactDeploymentInfo<TNetwork>>;

export type DeploymentInformation = {
Expand Down Expand Up @@ -80,7 +78,7 @@ export class ContractArtifact<TContract extends Contract> {
* @param networkName the name of the network where the contract is deployed
* @returns the address of the deployed contract
*/
getAddress(networkName: CurrencyTypes.EvmChainName, version = this.lastVersion): string {
getAddress(networkName: CurrencyTypes.VMChainName, version = this.lastVersion): string {
return this.getDeploymentInformation(networkName, version).address;
}

Expand All @@ -106,11 +104,11 @@ export class ContractArtifact<TContract extends Contract> {
getAllAddressesFromAllNetworks(): {
version: string;
address: string;
networkName: CurrencyTypes.EvmChainName;
networkName: CurrencyTypes.VMChainName;
}[] {
const deployments = [];
for (const version in this.info) {
let networkName: CurrencyTypes.EvmChainName;
let networkName: CurrencyTypes.VMChainName;
for (networkName in this.info[version].deployment) {
const address = this.info[version].deployment[networkName]?.address;
if (!address) continue;
Expand Down Expand Up @@ -144,7 +142,7 @@ export class ContractArtifact<TContract extends Contract> {
* @returns The address and the number of the creation block
*/
getDeploymentInformation(
networkName: CurrencyTypes.EvmChainName,
networkName: CurrencyTypes.VMChainName,
version = this.lastVersion,
): DeploymentInformation {
const versionInfo = this.info[version];
Expand Down
5 changes: 5 additions & 0 deletions packages/types/src/currency-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ export type BtcChainName = 'mainnet' | 'testnet';
export type NearChainName = 'aurora' | 'aurora-testnet' | 'near' | 'near-testnet';

export type ChainName = EvmChainName | BtcChainName | NearChainName;

/**
* Virtual machin chains, where payment proxy contracts can be deployed
*/
export type VMChainName = EvmChainName | NearChainName;