Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/dsdk 284 create CAL service loaders #6790

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
[
{
"inputs": [
{
"internalType": "address[]",
"name": "fromToken",
"type": "address[]"
}
],
"name": "arrayParam",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "address1",
"type": "address"
},
{
"components": [
{
"components": [
{
"components": [
{
"internalType": "address[]",
"name": "addresses",
"type": "address[]"
}
],
"internalType": "struct SimpleContract.Struct3",
"name": "param3",
"type": "tuple"
}
],
"internalType": "struct SimpleContract.Struct2[]",
"name": "param2",
"type": "tuple[]"
}
],
"internalType": "struct SimpleContract.Struct1",
"name": "param1",
"type": "tuple"
}
],
"internalType": "struct SimpleContract.ComplexStruct",
"name": "complexStruct",
"type": "tuple"
}
],
"name": "complexStructParam",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "fromToken",
"type": "address"
},
{
"internalType": "address",
"name": "toToken",
"type": "address"
}
],
"name": "multipleParams",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "fromToken",
"type": "address"
}
],
"name": "singleParam",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.8.2 <0.9.0;

contract SimpleContract {
struct Struct3 {
address[] addresses;
}

struct Struct2 {
Struct3 param3;
}

struct Struct1 {
Struct2[] param2;
}

struct ComplexStruct {
address address1;
Struct1 param1;
}

function singleParam(address fromToken) public {
// Do nothing
}

function multipleParams(address fromToken, address toToken) public {
// Do nothing
}

function arrayParam(address[] calldata fromToken) public {
// Do nothing
}

function complexStructParam(ComplexStruct calldata complexStruct) public {
// Do nothing
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export interface DappDTO {
b2c: B2c;
abis: Abis;
b2c_signatures: B2cSignatures;
}

export interface B2c {
blockchainName: string;
chainId: number;
contracts: Contract[];
name: string;
}

interface Contract {
address: string;
contractName: string;
selectors: { [selector: string]: ContractSelector };
}

interface ContractSelector {
erc20OfInterest: string[];
method: string;
plugin: string;
}

export interface Abis {
[address: string]: object[];
}

export interface B2cSignatures {
[address: string]: {
[selector: string]: B2cSignature;
};
}

interface B2cSignature {
plugin: string;
serialized_data: string;
signature: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { DappInfos } from "../model/DappInfos";

export type GetDappInfos = {
address: string;
selector: `0x${string}`;
chainId: number;
};

export interface ExternalPluginDataSource {
getDappInfos(params: GetDappInfos): Promise<DappInfos | undefined>;
}