UNPKG

@uniswap/v4-core

Version:

🦄 Core smart contracts of Uniswap v4

1 lines • 18.6 kB
{"abi":[{"type":"function","name":"collectProtocolFees","inputs":[{"name":"recipient","type":"address","internalType":"address"},{"name":"currency","type":"address","internalType":"Currency"},{"name":"amount","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"amountCollected","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"protocolFeeController","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"protocolFeesAccrued","inputs":[{"name":"currency","type":"address","internalType":"Currency"}],"outputs":[{"name":"amount","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"setProtocolFee","inputs":[{"name":"key","type":"tuple","internalType":"struct PoolKey","components":[{"name":"currency0","type":"address","internalType":"Currency"},{"name":"currency1","type":"address","internalType":"Currency"},{"name":"fee","type":"uint24","internalType":"uint24"},{"name":"tickSpacing","type":"int24","internalType":"int24"},{"name":"hooks","type":"address","internalType":"contract IHooks"}]},{"name":"newProtocolFee","type":"uint24","internalType":"uint24"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setProtocolFeeController","inputs":[{"name":"controller","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"ProtocolFeeControllerUpdated","inputs":[{"name":"protocolFeeController","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"ProtocolFeeUpdated","inputs":[{"name":"id","type":"bytes32","indexed":true,"internalType":"PoolId"},{"name":"protocolFee","type":"uint24","indexed":false,"internalType":"uint24"}],"anonymous":false},{"type":"error","name":"InvalidCaller","inputs":[]},{"type":"error","name":"ProtocolFeeCurrencySynced","inputs":[]},{"type":"error","name":"ProtocolFeeTooLarge","inputs":[{"name":"fee","type":"uint24","internalType":"uint24"}]}],"bytecode":{"object":"0x","sourceMap":"","linkReferences":{}},"deployedBytecode":{"object":"0x","sourceMap":"","linkReferences":{}},"methodIdentifiers":{"collectProtocolFees(address,address,uint256)":"8161b874","protocolFeeController()":"f02de3b2","protocolFeesAccrued(address)":"97e8cd4e","setProtocolFee((address,address,uint24,int24,address),uint24)":"7e87ce7d","setProtocolFeeController(address)":"2d771389"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ProtocolFeeCurrencySynced\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"}],\"name\":\"ProtocolFeeTooLarge\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"protocolFeeController\",\"type\":\"address\"}],\"name\":\"ProtocolFeeControllerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"PoolId\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"protocolFee\",\"type\":\"uint24\"}],\"name\":\"ProtocolFeeUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"Currency\",\"name\":\"currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"collectProtocolFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountCollected\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFeeController\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Currency\",\"name\":\"currency\",\"type\":\"address\"}],\"name\":\"protocolFeesAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"Currency\",\"name\":\"currency0\",\"type\":\"address\"},{\"internalType\":\"Currency\",\"name\":\"currency1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"},{\"internalType\":\"contract IHooks\",\"name\":\"hooks\",\"type\":\"address\"}],\"internalType\":\"struct PoolKey\",\"name\":\"key\",\"type\":\"tuple\"},{\"internalType\":\"uint24\",\"name\":\"newProtocolFee\",\"type\":\"uint24\"}],\"name\":\"setProtocolFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"setProtocolFeeController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"collectProtocolFees(address,address,uint256)\":{\"details\":\"This will revert if the contract is unlocked\",\"params\":{\"amount\":\"The amount of currency to withdraw\",\"currency\":\"The currency to withdraw\",\"recipient\":\"The address to receive the protocol fees\"},\"returns\":{\"amountCollected\":\"The amount of currency successfully withdrawn\"}},\"protocolFeeController()\":{\"returns\":{\"_0\":\"address The current protocol fee controller address\"}},\"protocolFeesAccrued(address)\":{\"params\":{\"currency\":\"The currency to check\"},\"returns\":{\"amount\":\"The amount of protocol fees accrued in the currency\"}},\"setProtocolFee((address,address,uint24,int24,address),uint24)\":{\"params\":{\"key\":\"The key of the pool to set a protocol fee for\",\"newProtocolFee\":\"The fee to set\"}},\"setProtocolFeeController(address)\":{\"params\":{\"controller\":\"The new protocol fee controller\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"InvalidCaller()\":[{\"notice\":\"Thrown when collectProtocolFees or setProtocolFee is not called by the controller.\"}],\"ProtocolFeeCurrencySynced()\":[{\"notice\":\"Thrown when collectProtocolFees is attempted on a token that is synced.\"}],\"ProtocolFeeTooLarge(uint24)\":[{\"notice\":\"Thrown when protocol fee is set too high\"}]},\"events\":{\"ProtocolFeeControllerUpdated(address)\":{\"notice\":\"Emitted when the protocol fee controller address is updated in setProtocolFeeController.\"},\"ProtocolFeeUpdated(bytes32,uint24)\":{\"notice\":\"Emitted when the protocol fee is updated for a pool.\"}},\"kind\":\"user\",\"methods\":{\"collectProtocolFees(address,address,uint256)\":{\"notice\":\"Collects the protocol fees for a given recipient and currency, returning the amount collected\"},\"protocolFeeController()\":{\"notice\":\"Returns the current protocol fee controller address\"},\"protocolFeesAccrued(address)\":{\"notice\":\"Given a currency address, returns the protocol fees accrued in that currency\"},\"setProtocolFee((address,address,uint24,int24,address),uint24)\":{\"notice\":\"Sets the protocol fee for the given pool\"},\"setProtocolFeeController(address)\":{\"notice\":\"Sets the protocol fee controller\"}},\"notice\":\"Interface for all protocol-fee related functions in the pool manager\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/IProtocolFees.sol\":\"IProtocolFees\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":44444444},\"remappings\":[\":@ensdomains/=node_modules/@ensdomains/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":solmate/=lib/solmate/\"],\"viaIR\":true},\"sources\":{\"src/interfaces/IHooks.sol\":{\"keccak256\":\"0xc131ffa2d04c10a012fe715fe2c115811526b7ea34285cf0a04ce7ce8320da8d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3b212358897db5d99c21244d88f97b2e788527552cb430629b472a8cc6289aec\",\"dweb:/ipfs/QmQtwV4dDe2RYk2ErLpaAX7U82jWh1L6Lw2HRuKDvBi84G\"]},\"src/interfaces/IProtocolFees.sol\":{\"keccak256\":\"0x32a666e588a2f66334430357bb1e2424fe7eebeb98a3364b1dd16eb6ccca9848\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://85751d302125881f72e5f8af051c2d5d9b1f606ebaea8ca7d04fccdd27cc252d\",\"dweb:/ipfs/QmeRwomeh9NWm6A6fgNA4KZPQZHPpdKsPQyYsHSFmvud7J\"]},\"src/interfaces/external/IERC20Minimal.sol\":{\"keccak256\":\"0xeccadf1bf69ba2eb51f2fe4fa511bc7bb05bbd6b9f9a3cb8e5d83d9582613e0f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://118757369892687b99ef46ce28d6861f62c098285bd7687a4f17f7e44e5f81de\",\"dweb:/ipfs/QmUxqbYqQtcEwwFbb9e6BBMePEaSgN8C45v6RKubD4ib8d\"]},\"src/libraries/CustomRevert.sol\":{\"keccak256\":\"0x111ed3031b6990c80a93ae35dde6b6ac0b7e6af471388fdd7461e91edda9b7de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c9ea883c98d6ae1829160d0977bb5195761cfd5bc81692d0a941f45717f594cd\",\"dweb:/ipfs/QmZPwxzaeMNv536wzrAMrMswu7vMHuqPVpjcqL3YvCMoxt\"]},\"src/libraries/SafeCast.sol\":{\"keccak256\":\"0x42c4a24f996a14d358be397b71f7ec9d7daf666aaec78002c63315a6ee67aa86\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c3db86e2ba3679105fc32edec656c70282e1fede6cab11217702443f6c26fa59\",\"dweb:/ipfs/QmX4yaaSPdKQzYNRsezjTvZKsubzS8JRTEGFD3fPpTTCcj\"]},\"src/types/BalanceDelta.sol\":{\"keccak256\":\"0xa719c8fe51e0a9524280178f19f6851bcc3b3b60e73618f3d60905d35ae5569f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7436928dc9de35c6c7c5c636cb51adaf295cfd590da83b19a004ae33cbec9ef9\",\"dweb:/ipfs/QmRJ9yZkUpzk4433GX3LgVVL8jwpbSYSUwXcucKisf3v4H\"]},\"src/types/BeforeSwapDelta.sol\":{\"keccak256\":\"0x2a774312d91285313d569da1a718c909655da5432310417692097a1d4dc83a78\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2c7a0379955cff9c17ab9e61f95e42909aa5947c22740f86ce940d09856f782\",\"dweb:/ipfs/QmaAuo8UBYXsGrVuKh8iRoAAdqwtg1jDq515cW1ZRP5m9K\"]},\"src/types/Currency.sol\":{\"keccak256\":\"0x4a0b84b282577ff6f8acf13ec9f4d32dbb9348748b49611d00e68bee96609c93\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://45f9d62ab3d51b52957279e353853ba1547c3182c9a1e3d1846ada4a90263b01\",\"dweb:/ipfs/QmS8NG84ccQS1yXVD8cv3eKX7J1UKxuJhbUfHTQR2opKF5\"]},\"src/types/PoolId.sol\":{\"keccak256\":\"0x308311916ea0f5c2fd878b6a2751eb223d170a69e33f601fae56dfe3c5d392af\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://669c2cd7ac17690b5d8831e0bda72822376c3a04b36afed6d31df4d75fe60918\",\"dweb:/ipfs/QmT6EpkxqU8VF3WsgrZ66F3s1cCQRffR95z1HDYZz7ph6y\"]},\"src/types/PoolKey.sol\":{\"keccak256\":\"0xf89856e0580d7a4856d3187a76858377ccee9d59702d230c338d84388221b786\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f3118fa189025695c37fdf0bdd1190f085ad097484d3c88cf4c56d1db65f639\",\"dweb:/ipfs/QmamXpgtB8GV1CaFLvqefPWSoikLDhMk1yU4heBnVzU8gi\"]},\"src/types/PoolOperation.sol\":{\"keccak256\":\"0x7a1a107fc1f2208abb2c9364c8c54e56e98dca27673e9441bed2b949b6382162\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4ad2470383bc5595d5af17840c64971f457adac68895a4db41ba5c71a4478e07\",\"dweb:/ipfs/QmdwKhBHDZFuqXrR2BfDBD9r7rB2ULGQBznsajRTkTmL4c\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[],"type":"error","name":"InvalidCaller"},{"inputs":[],"type":"error","name":"ProtocolFeeCurrencySynced"},{"inputs":[{"internalType":"uint24","name":"fee","type":"uint24"}],"type":"error","name":"ProtocolFeeTooLarge"},{"inputs":[{"internalType":"address","name":"protocolFeeController","type":"address","indexed":true}],"type":"event","name":"ProtocolFeeControllerUpdated","anonymous":false},{"inputs":[{"internalType":"PoolId","name":"id","type":"bytes32","indexed":true},{"internalType":"uint24","name":"protocolFee","type":"uint24","indexed":false}],"type":"event","name":"ProtocolFeeUpdated","anonymous":false},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"Currency","name":"currency","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"collectProtocolFees","outputs":[{"internalType":"uint256","name":"amountCollected","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"protocolFeeController","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[{"internalType":"Currency","name":"currency","type":"address"}],"stateMutability":"view","type":"function","name":"protocolFeesAccrued","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}]},{"inputs":[{"internalType":"struct PoolKey","name":"key","type":"tuple","components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}]},{"internalType":"uint24","name":"newProtocolFee","type":"uint24"}],"stateMutability":"nonpayable","type":"function","name":"setProtocolFee"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"setProtocolFeeController"}],"devdoc":{"kind":"dev","methods":{"collectProtocolFees(address,address,uint256)":{"details":"This will revert if the contract is unlocked","params":{"amount":"The amount of currency to withdraw","currency":"The currency to withdraw","recipient":"The address to receive the protocol fees"},"returns":{"amountCollected":"The amount of currency successfully withdrawn"}},"protocolFeeController()":{"returns":{"_0":"address The current protocol fee controller address"}},"protocolFeesAccrued(address)":{"params":{"currency":"The currency to check"},"returns":{"amount":"The amount of protocol fees accrued in the currency"}},"setProtocolFee((address,address,uint24,int24,address),uint24)":{"params":{"key":"The key of the pool to set a protocol fee for","newProtocolFee":"The fee to set"}},"setProtocolFeeController(address)":{"params":{"controller":"The new protocol fee controller"}}},"version":1},"userdoc":{"kind":"user","methods":{"collectProtocolFees(address,address,uint256)":{"notice":"Collects the protocol fees for a given recipient and currency, returning the amount collected"},"protocolFeeController()":{"notice":"Returns the current protocol fee controller address"},"protocolFeesAccrued(address)":{"notice":"Given a currency address, returns the protocol fees accrued in that currency"},"setProtocolFee((address,address,uint24,int24,address),uint24)":{"notice":"Sets the protocol fee for the given pool"},"setProtocolFeeController(address)":{"notice":"Sets the protocol fee controller"}},"version":1}},"settings":{"remappings":["@ensdomains/=node_modules/@ensdomains/","@openzeppelin/=lib/openzeppelin-contracts/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","hardhat/=node_modules/hardhat/","openzeppelin-contracts/=lib/openzeppelin-contracts/","solmate/=lib/solmate/"],"optimizer":{"enabled":true,"runs":44444444},"metadata":{"bytecodeHash":"none"},"compilationTarget":{"src/interfaces/IProtocolFees.sol":"IProtocolFees"},"evmVersion":"cancun","libraries":{},"viaIR":true},"sources":{"src/interfaces/IHooks.sol":{"keccak256":"0xc131ffa2d04c10a012fe715fe2c115811526b7ea34285cf0a04ce7ce8320da8d","urls":["bzz-raw://3b212358897db5d99c21244d88f97b2e788527552cb430629b472a8cc6289aec","dweb:/ipfs/QmQtwV4dDe2RYk2ErLpaAX7U82jWh1L6Lw2HRuKDvBi84G"],"license":"MIT"},"src/interfaces/IProtocolFees.sol":{"keccak256":"0x32a666e588a2f66334430357bb1e2424fe7eebeb98a3364b1dd16eb6ccca9848","urls":["bzz-raw://85751d302125881f72e5f8af051c2d5d9b1f606ebaea8ca7d04fccdd27cc252d","dweb:/ipfs/QmeRwomeh9NWm6A6fgNA4KZPQZHPpdKsPQyYsHSFmvud7J"],"license":"MIT"},"src/interfaces/external/IERC20Minimal.sol":{"keccak256":"0xeccadf1bf69ba2eb51f2fe4fa511bc7bb05bbd6b9f9a3cb8e5d83d9582613e0f","urls":["bzz-raw://118757369892687b99ef46ce28d6861f62c098285bd7687a4f17f7e44e5f81de","dweb:/ipfs/QmUxqbYqQtcEwwFbb9e6BBMePEaSgN8C45v6RKubD4ib8d"],"license":"MIT"},"src/libraries/CustomRevert.sol":{"keccak256":"0x111ed3031b6990c80a93ae35dde6b6ac0b7e6af471388fdd7461e91edda9b7de","urls":["bzz-raw://c9ea883c98d6ae1829160d0977bb5195761cfd5bc81692d0a941f45717f594cd","dweb:/ipfs/QmZPwxzaeMNv536wzrAMrMswu7vMHuqPVpjcqL3YvCMoxt"],"license":"MIT"},"src/libraries/SafeCast.sol":{"keccak256":"0x42c4a24f996a14d358be397b71f7ec9d7daf666aaec78002c63315a6ee67aa86","urls":["bzz-raw://c3db86e2ba3679105fc32edec656c70282e1fede6cab11217702443f6c26fa59","dweb:/ipfs/QmX4yaaSPdKQzYNRsezjTvZKsubzS8JRTEGFD3fPpTTCcj"],"license":"MIT"},"src/types/BalanceDelta.sol":{"keccak256":"0xa719c8fe51e0a9524280178f19f6851bcc3b3b60e73618f3d60905d35ae5569f","urls":["bzz-raw://7436928dc9de35c6c7c5c636cb51adaf295cfd590da83b19a004ae33cbec9ef9","dweb:/ipfs/QmRJ9yZkUpzk4433GX3LgVVL8jwpbSYSUwXcucKisf3v4H"],"license":"MIT"},"src/types/BeforeSwapDelta.sol":{"keccak256":"0x2a774312d91285313d569da1a718c909655da5432310417692097a1d4dc83a78","urls":["bzz-raw://a2c7a0379955cff9c17ab9e61f95e42909aa5947c22740f86ce940d09856f782","dweb:/ipfs/QmaAuo8UBYXsGrVuKh8iRoAAdqwtg1jDq515cW1ZRP5m9K"],"license":"MIT"},"src/types/Currency.sol":{"keccak256":"0x4a0b84b282577ff6f8acf13ec9f4d32dbb9348748b49611d00e68bee96609c93","urls":["bzz-raw://45f9d62ab3d51b52957279e353853ba1547c3182c9a1e3d1846ada4a90263b01","dweb:/ipfs/QmS8NG84ccQS1yXVD8cv3eKX7J1UKxuJhbUfHTQR2opKF5"],"license":"MIT"},"src/types/PoolId.sol":{"keccak256":"0x308311916ea0f5c2fd878b6a2751eb223d170a69e33f601fae56dfe3c5d392af","urls":["bzz-raw://669c2cd7ac17690b5d8831e0bda72822376c3a04b36afed6d31df4d75fe60918","dweb:/ipfs/QmT6EpkxqU8VF3WsgrZ66F3s1cCQRffR95z1HDYZz7ph6y"],"license":"MIT"},"src/types/PoolKey.sol":{"keccak256":"0xf89856e0580d7a4856d3187a76858377ccee9d59702d230c338d84388221b786","urls":["bzz-raw://6f3118fa189025695c37fdf0bdd1190f085ad097484d3c88cf4c56d1db65f639","dweb:/ipfs/QmamXpgtB8GV1CaFLvqefPWSoikLDhMk1yU4heBnVzU8gi"],"license":"MIT"},"src/types/PoolOperation.sol":{"keccak256":"0x7a1a107fc1f2208abb2c9364c8c54e56e98dca27673e9441bed2b949b6382162","urls":["bzz-raw://4ad2470383bc5595d5af17840c64971f457adac68895a4db41ba5c71a4478e07","dweb:/ipfs/QmdwKhBHDZFuqXrR2BfDBD9r7rB2ULGQBznsajRTkTmL4c"],"license":"MIT"}},"version":1},"id":39}