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

add batchers + build functions #10

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": "standard-with-typescript",
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one rule I feel like is practically indespensible is no hanging promises https://github.com/usecannon/cannon/blob/main/.eslintrc.json#L55

}
}
8 changes: 8 additions & 0 deletions contracts/IERC2771Context.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/ERC2771Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (metatx/ERC2771Context.sol)
pragma solidity ^0.8.20;

interface IERC2771Context {
function isTrustedForwarder(address forwarder) external view returns (bool);
}
11 changes: 11 additions & 0 deletions contracts/ISmartAccount.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// https://github.com/bcnmy/scw-contracts/blob/main/contracts/smart-account/SmartAccount.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface ISmartAccount {
function executeBatch(
address[] calldata dest,
uint256[] calldata value,
bytes[] calldata func
) external;
}
21 changes: 21 additions & 0 deletions contracts/ITrustedMulticallForwarder.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// https://github.com/Synthetixio/synthetix-v3/blob/main/auxiliary/TrustedMulticallForwarder/src/TrustedMulticallForwarder.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface ITrustedMulticallForwarder {
struct Call3Value {
address target;
bool requireSuccess;
uint256 value;
bytes callData;
}

struct Result {
bool success;
bytes returnData;
}

function aggregate3Value(
Call3Value[] calldata calls
) external payable returns (Result[] memory returnData);
}
Loading