{"_id":"@bootnodedev/intents-framework-core","_rev":"3-1a21f9c14618371941391b539a958a99","name":"@bootnodedev/intents-framework-core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bootnodedev/intents-framework-core","version":"0.1.0","keywords":[],"author":{"name":"BootNode"},"_id":"@bootnodedev/intents-framework-core@0.1.0","maintainers":[{"name":"pablofullana","email":"pablofullana@gmail.com"},{"name":"luchobonatti.bn","email":"luciano@bootnode.dev"},{"name":"gabitoesmiapodo","email":"exepotes@gmail.com"},{"name":"fernandomg","email":"fernando.greco@gmail.com"},{"name":"lmcorbalan","email":"lmcorbalan@gmail.com"}],"dist":{"shasum":"d82a67c7e84b82856228c50d395a447a59bbcd21","tarball":"https://registry.npmjs.org/@bootnodedev/intents-framework-core/-/intents-framework-core-0.1.0.tgz","fileCount":401,"integrity":"sha512-Dyj1bMerVD1QHqNLoyikgKC+MyTonW5C4adt4nZcbyscvMkcJkHx8c4F3/9vYKb8n1mZKJlSjD4AXavjDqtwig==","signatures":[{"sig":"MEQCIDWYwooqI1J2cDBi5Yyg1Q/SrHX+wUcafsovI5flks7hAiA2ZTe4prZkfAW/+SQktU7jSV2N9PrDpacM8lyU22TDug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2026121},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./mailbox":"./dist/contracts/Mailbox.js","./contracts":"./contracts","./buildArtifact.js":"./dist/buildArtifact.js","./buildArtifact.json":"./dist/buildArtifact.json"},"gitHead":"3111dca37a6b5c67ec6cd9961183d85dd9aa62d5","scripts":{"lint":"yarn lint:sol && yarn prettier:check","test":"forge test -vvv","build":"yarn hardhat-esm compile && tsc && ./exportBuildArtifact.sh","clean":"yarn hardhat-esm clean && rm -rf ./dist ./cache ./cache_hardhat ./types ./coverage ./out ./forge-cache ./fixtures && forge clean","sol:fmt":"forge fmt","lint:sol":"forge fmt --check && solhint \"{script,src,test}/**/*.sol\"","openOrder":"forge script script/OpenOrder.s.sol:OpenOrder -f $NETWORK --broadcast --verify --slow -vvv","deployToken":"forge script script/DeployToken.s.sol:DeployToken -f $NETWORK --broadcast --verify --slow -vvv","forge:build":"forge build","hardhat-esm":"NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat --config hardhat.config.cts","run:openOrder":"dotenv-run-script openOrder","test:coverage":"forge coverage --no-match-coverage \"(test|mock|node_modules|script)\"","prettier:check":"prettier --check \"**/*.{json,md,yml}\" --ignore-path \".prettierignore\"","prettier:write":"prettier --write \"**/*.{json,md,yml}\" --ignore-path \".prettierignore\"","run:deployToken":"dotenv-run-script deployToken","deployHyperlane7683":"forge script script/DeployHyperlane7683.s.sol:DeployHyperlane7683 -f $NETWORK --broadcast --verify --slow -vvv","test:coverage:report":"forge coverage --no-match-coverage \"(test|mock|node_modules|script)\" --report lcov && genhtml lcov.info --ignore-errors inconsistent,inconsistent --branch-coverage --output-dir coverage","run:deployHyperlane7683":"dotenv-run-script deployHyperlane7683"},"_npmUser":{"name":"lmcorbalan","email":"lmcorbalan@gmail.com"},"_npmVersion":"10.2.4","description":"Core solidity contracts for the Intent Framework","directories":{},"_nodeVersion":"20.11.1","dependencies":{"@uniswap/permit2":"github:Uniswap/permit2","dotenv-run-script":"^0.4.1","@hyperlane-xyz/core":"^5.4.1","@openzeppelin/contracts":"^4.9.6"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.1","ethers":"^5.7.2","hardhat":"^2.22.18","solhint":"^3.6.2","ts-node":"^10.8.0","prettier":"^3.0.0","forge-std":"github:foundry-rs/forge-std#v1.8.1","typechain":"patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch","typescript":"5.3.3","@types/node":"^22.10.7","ts-generator":"^0.1.1","@typechain/hardhat":"^9.1.0","@typechain/ethers-v5":"^11.1.2","@typechain/ethers-v6":"^0.5.1","@nomiclabs/hardhat-ethers":"^2.2.3","@nomicfoundation/hardhat-foundry":"^1.1.3","@nomicfoundation/hardhat-toolbox":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/intents-framework-core_0.1.0_1738081791993_0.17311802318344083","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-01-28T16:29:51.899Z","modified":"2026-07-28T18:22:22.246Z","0.1.0":"2025-01-28T16:29:52.233Z"},"author":{"name":"BootNode"},"keywords":[],"description":"Core solidity contracts for the Intent Framework","maintainers":[{"email":"pablofullana@gmail.com","name":"pablofullana"},{"email":"luciano@bootnode.dev","name":"luchobonatti.bn"},{"email":"exepotes@gmail.com","name":"gabitoesmiapodo"},{"email":"fernando.greco@gmail.com","name":"fernandomg"},{"email":"lmcorbalan@gmail.com","name":"lmcorbalan"},{"email":"nicolas@bootnode.dev","name":"nico_bn"},{"email":"zavaliafernando+npmjs@gmail.com","name":"fzavalia"}],"readme":"# ERC7683 Reference Implementation\n\n## Overview\n\nThis project is centered around the [Base7683](./src/Base7683.sol) contract, which serves as the foundational component\nfor implementing the interfaces defined in the\n[ERC7683 specification](https://github.com/across-protocol/ERCs/blob/master/ERCS/erc-7683.md). The contract is designed\nto be highly flexible, supporting any `orderDataType` and `orderData`. The logic for handling specific `orderData` types\nwithin the process of resolving and filling orders is intentionally left unimplemented, allowing inheriting contracts to\ndefine this behavior.\n\nWhile adhering to the `ERC7683` standard, `Base7683` introduces additional functionality for `settling` and `refunding`\norders. These functions are not part of the `ERC7683` specification but are included to provide a unified interface for\nsolvers and users across all implementations built on this framework.\n\nInheriting contracts must implement several key internal functions to define their specific logic for order resolution,\nfilling, settlement, and refunds. These include:\n\n- `_resolveOrder(GaslessCrossChainOrder memory _order)` and `_resolveOrder(OnchainCrossChainOrder memory _order)` for\n  resolving orders into a hydrated format.\n- `_fillOrder(bytes32 _orderId, bytes calldata _originData, bytes calldata _fillerData)` for processing and filling\n  orders.\n- `_settleOrders(bytes32[] calldata _orderIds, bytes[] memory _ordersOriginData, bytes[] memory _ordersFillerData)` for\n  settling batches of orders.\n- `_refundOrders` for both `OnchainCrossChainOrder` and `GaslessCrossChainOrder` types, enabling the implementation of\n  specific refund logic.\n- `_localDomain()` to retrieve the local domain identifier.\n- `_getOrderId` for computing unique identifiers for both `GaslessCrossChainOrder` and `OnchainCrossChainOrder` types.\n\nThese functions ensure that each inheriting contract provides its specific behavior while maintaining a consistent\ninterface across the framework. You'll find more details of this function interfaces documented on the\n[Base7683](./src/Base7683.sol).\n\nAs reference, the following contracts build upon `Base7683`:\n\n1. [BasicSwap7683](./src/BasicSwap7683.sol) The `BasicSwap7683` contract extends `Base7683` by implementing logic for a\n   specific `orderData` type as defined in the [OrderEncoder](./src/libs/OrderEncoder.sol). This implementation\n   facilitates token swaps, enabling the exchange of an `inputToken` on the origin chain for an `outputToken` on the\n   destination chain.\n\n2. [Hyperlane7683](./src/Hyperlane7683.sol) The `Hyperlane7683` contract builds on `BasicSwap7683` by integrating\n   `Hyperlane` as the interchain messaging layer. This layer ensures seamless communication between chains during order\n   execution.\n\n## Extensibility\n\nBoth `BasicSwap7683` and `Hyperlane7683` are designed to be modular and extensible. Developers can use them as reference\nimplementations to create custom solutions. For example:\n\n- To implement a different `orderData` type, you could replace `BasicSwap7683` with a new contract that inherits from\n  `Base7683`. The `Hyperlane7683` contract can remain unchanged and continue to provide messaging functionality.\n- Alternatively, you could replace the Hyperlane-based messaging layer in `Hyperlane7683` with another interchain\n  messaging protocol while retaining the `BasicSwap7683` logic.\n\nThis modular approach enables a high degree of flexibility, allowing developers to adapt the framework to various use\ncases and requirements.\n\n## Scripts\n\n### Deploy\n\n- Run `npm install` from the root of the monorepo to install all the dependencies\n- Create a `.env` file base on the [.env.example file](./.env.example) file, and set the required variables depending\n  which script you are going to run.\n\nSet the following environment variables required for running all the scripts, on each network.\n\n- `NETWORK`: the name of the network you want to run the script\n- `ETHERSCAN_API_KEY`: your Etherscan API key\n- `API_KEY_ALCHEMY`: your Alchemy API key\n\nIf the network is not listed under the `rpc_endpoints` section of the [foundry.toml file](./foundry.toml) you'll have to\nadd a new entry for it.\n\nFor deploying the router you have to run the `npm run run:deployHyperlane7683`. Make sure the following environment\nvariable are set:\n\n- `DEPLOYER_PK`: deployer private key\n- `MAILBOX`: address of Hyperlane Mailbox contract on the chain\n- `PERMIT2`: Permit2 address on `NETWORK_NAME`\n- `ROUTER_OWNER`: address of the router owner\n- `PROXY_ADMIN_OWNER`: address of the ProxyAdmin owner, `ROUTER_OWNER` would be used if this is not set. The router is\n  deployed using a `TransparentUpgradeableProxy`, so a ProxyAdmin contract is deployed and set as the admin of the\n  proxy.\n- `HYPERLANE7683_SALT`: a single use by chain salt for deploying the the router. Make sure you use the same on all\n  chains so the routers are deployed all under the same address.\n- `DOMAINS`: the domains list of the routers to enroll, separated by commas\n\n### Open an Order\n\nFor opening an onchain order you can run `npm run run:openOrder`. Make sure the following environment variable are set:\n\n- `ROUTER_OWNER_PK`: the router's owner private key. Only the owner can enroll routers\n- `ORDER_SENDER`: address of order sender\n- `ORDER_RECIPIENT`: address of order recipient\n- `ITT_INPUT`: token input address\n- `ITT_OUTPUT`: token output address\n- `AMOUNT_IN`: amount in\n- `AMOUNT_OUT`: amount out\n- `DESTINATION_DOMAIN`: destination domain id\n\n---\n\n## Usage\n\nThis is a list of the most frequently needed commands.\n\n### Build\n\nBuild the contracts:\n\n```sh\n$ yarn build\n```\n\n### Clean\n\nDelete the build artifacts and cache directories:\n\n```sh\n$ yarn clean\n```\n\n### Coverage\n\nGet a test coverage report:\n\n```sh\n$ yarn coverage\n```\n\n### Format\n\nFormat the contracts:\n\n```sh\n$ yarn sol:fmt\n```\n\n### Gas Usage\n\n### Lint\n\nLint the contracts:\n\n```sh\n$ yarn lint\n```\n\n### Test\n\nRun the tests:\n\n```sh\n$ yarn test\n```\n\nGenerate test coverage and output result to the terminal:\n\n```sh\n$ yarn test:coverage\n```\n\nGenerate test coverage with lcov report (you'll have to open the `./coverage/index.html` file in your browser, to do so\nsimply copy paste the path):\n\n```sh\n$ yarn test:coverage:report\n```\n","readmeFilename":"README.md"}