Skip to content

Commit

Permalink
GITBOOK-347: DLN Hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Listvan authored and gitbook-bot committed Oct 8, 2024
1 parent 56d5f37 commit 495a877
Show file tree
Hide file tree
Showing 14 changed files with 1,709 additions and 12 deletions.
771 changes: 771 additions & 0 deletions docs/.gitbook/assets/DlnExternalCallAdapter.abi.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions docs/.gitbook/assets/DlnExternalCallLib.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

library DlnExternalCallLib {
struct ExternalCallEnvelopV1 {
// Address that will receive takeToken if ext call failed
address fallbackAddress;
// *optional. Smart contract that will execute ext call.
address executorAddress;
// fee that will pay for executor who will execute ext call
uint160 executionFee;
// If false, the taker must execute an external call with fulfill in a single transaction.
bool allowDelayedExecution;
// if true transaction that will execute ext call will fail if ext call is not success
bool requireSuccessfullExecution;
bytes payload;
}

struct ExternalCallPayload {
// the address of the contract to call
address to;
// *optional. Tx gas for execute ext call
uint32 txGas;
bytes callData;
}
}
369 changes: 369 additions & 0 deletions docs/.gitbook/assets/ExternalCallExecutor.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,369 @@
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "AdapterBadRole",
"type": "error"
},
{
"inputs": [],
"name": "AdminBadRole",
"type": "error"
},
{
"inputs": [],
"name": "CallFailed",
"type": "error"
},
{
"inputs": [],
"name": "EthTransferFailed",
"type": "error"
},
{
"inputs": [],
"name": "NotEnoughTxGas",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "previousAdminRole",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "newAdminRole",
"type": "bytes32"
}
],
"name": "RoleAdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "RoleGranted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "RoleRevoked",
"type": "event"
},
{
"inputs": [],
"name": "ADAPTER_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "DEFAULT_ADMIN_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
}
],
"name": "getRoleAdmin",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "grantRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "hasRole",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "isProhibitedSelector",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_transferredAmount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_fallbackAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "onERC20Received",
"outputs": [
{
"internalType": "bool",
"name": "callSucceeded",
"type": "bool"
},
{
"internalType": "bytes",
"name": "callResult",
"type": "bytes"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_fallbackAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "onEtherReceived",
"outputs": [
{
"internalType": "bool",
"name": "callSucceeded",
"type": "bool"
},
{
"internalType": "bytes",
"name": "callResult",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "renounceRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "rescueFunds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "revokeRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]
Loading

0 comments on commit 495a877

Please sign in to comment.