├── .github └── workflows │ └── test.yml ├── .gitignore ├── .gitmodules ├── README.md ├── REPORT.md ├── foundry.toml ├── lib ├── forge-std │ ├── .github │ │ └── workflows │ │ │ └── ci.yml │ ├── .gitignore │ ├── .gitmodules │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── foundry.toml │ ├── lib │ │ └── ds-test │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── default.nix │ │ │ ├── demo │ │ │ └── demo.sol │ │ │ ├── package.json │ │ │ └── src │ │ │ └── test.sol │ ├── package.json │ ├── src │ │ ├── Base.sol │ │ ├── Script.sol │ │ ├── StdAssertions.sol │ │ ├── StdChains.sol │ │ ├── StdCheats.sol │ │ ├── StdError.sol │ │ ├── StdInvariant.sol │ │ ├── StdJson.sol │ │ ├── StdMath.sol │ │ ├── StdStorage.sol │ │ ├── StdUtils.sol │ │ ├── Test.sol │ │ ├── Vm.sol │ │ ├── console.sol │ │ ├── console2.sol │ │ └── interfaces │ │ │ ├── IERC1155.sol │ │ │ ├── IERC165.sol │ │ │ ├── IERC20.sol │ │ │ ├── IERC4626.sol │ │ │ ├── IERC721.sol │ │ │ └── IMulticall3.sol │ └── test │ │ ├── StdAssertions.t.sol │ │ ├── StdChains.t.sol │ │ ├── StdCheats.t.sol │ │ ├── StdError.t.sol │ │ ├── StdMath.t.sol │ │ ├── StdStorage.t.sol │ │ ├── StdUtils.t.sol │ │ ├── compilation │ │ ├── CompilationScript.sol │ │ ├── CompilationScriptBase.sol │ │ ├── CompilationTest.sol │ │ └── CompilationTestBase.sol │ │ └── fixtures │ │ └── broadcast.log.json └── helpers │ ├── BitUtils.sol │ └── Pretty.sol ├── package.json ├── run-forge.sh ├── src ├── aave │ ├── DataTypes.sol │ ├── IFlashloanReceiver.sol │ ├── ILendingPool.sol │ └── ILendingPoolAddressesProvider.sol ├── interfaces │ ├── IFactory.sol │ ├── IPool.sol │ ├── callback │ │ └── ISwapCallback.sol │ ├── periphery │ │ ├── IBasePositionManager.sol │ │ ├── IERC721Permit.sol │ │ ├── IRouter.sol │ │ ├── IRouterTokenHelper.sol │ │ └── base_position_manager │ │ │ └── IBasePositionManagerEvents.sol │ └── pool │ │ ├── IPoolActions.sol │ │ ├── IPoolEvents.sol │ │ └── IPoolStorage.sol └── libraries │ ├── FullMath.sol │ ├── MathConstants.sol │ ├── QtyDeltaMath.sol │ ├── QuadMath.sol │ ├── SafeCast.sol │ ├── SwapMath.sol │ └── TickMath.sol └── test ├── KyberswapLegacyTest.sol ├── KyberswapTest.sol └── Strings.sol /.github/workflows/test.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/.github/workflows/test.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/.gitignore -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/.gitmodules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/README.md -------------------------------------------------------------------------------- /REPORT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/REPORT.md -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/foundry.toml -------------------------------------------------------------------------------- /lib/forge-std/.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/.github/workflows/ci.yml -------------------------------------------------------------------------------- /lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | .vscode 4 | .idea 5 | -------------------------------------------------------------------------------- /lib/forge-std/.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/.gitmodules -------------------------------------------------------------------------------- /lib/forge-std/LICENSE-APACHE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/LICENSE-APACHE -------------------------------------------------------------------------------- /lib/forge-std/LICENSE-MIT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/LICENSE-MIT -------------------------------------------------------------------------------- /lib/forge-std/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/README.md -------------------------------------------------------------------------------- /lib/forge-std/foundry.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/foundry.toml -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/lib/ds-test/LICENSE -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/lib/ds-test/Makefile -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/default.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/lib/ds-test/default.nix -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/demo/demo.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/lib/ds-test/demo/demo.sol -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/lib/ds-test/package.json -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/src/test.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/lib/ds-test/src/test.sol -------------------------------------------------------------------------------- /lib/forge-std/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/package.json -------------------------------------------------------------------------------- /lib/forge-std/src/Base.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/Base.sol -------------------------------------------------------------------------------- /lib/forge-std/src/Script.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/Script.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdAssertions.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdAssertions.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdChains.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdChains.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdCheats.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdCheats.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdError.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdError.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdInvariant.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdInvariant.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdJson.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdJson.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdMath.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdMath.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdStorage.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdStorage.sol -------------------------------------------------------------------------------- /lib/forge-std/src/StdUtils.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/StdUtils.sol -------------------------------------------------------------------------------- /lib/forge-std/src/Test.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/Test.sol -------------------------------------------------------------------------------- /lib/forge-std/src/Vm.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/Vm.sol -------------------------------------------------------------------------------- /lib/forge-std/src/console.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/console.sol -------------------------------------------------------------------------------- /lib/forge-std/src/console2.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/console2.sol -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC1155.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/interfaces/IERC1155.sol -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC165.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/interfaces/IERC165.sol -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC20.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/interfaces/IERC20.sol -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC4626.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/interfaces/IERC4626.sol -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC721.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/interfaces/IERC721.sol -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IMulticall3.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/src/interfaces/IMulticall3.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdAssertions.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdAssertions.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdChains.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdChains.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdCheats.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdCheats.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdError.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdError.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdMath.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdMath.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdStorage.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdStorage.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/StdUtils.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/StdUtils.t.sol -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationScript.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/compilation/CompilationScript.sol -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationScriptBase.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/compilation/CompilationScriptBase.sol -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationTest.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/compilation/CompilationTest.sol -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationTestBase.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/compilation/CompilationTestBase.sol -------------------------------------------------------------------------------- /lib/forge-std/test/fixtures/broadcast.log.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/forge-std/test/fixtures/broadcast.log.json -------------------------------------------------------------------------------- /lib/helpers/BitUtils.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/helpers/BitUtils.sol -------------------------------------------------------------------------------- /lib/helpers/Pretty.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/lib/helpers/Pretty.sol -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/package.json -------------------------------------------------------------------------------- /run-forge.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/run-forge.sh -------------------------------------------------------------------------------- /src/aave/DataTypes.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/aave/DataTypes.sol -------------------------------------------------------------------------------- /src/aave/IFlashloanReceiver.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/aave/IFlashloanReceiver.sol -------------------------------------------------------------------------------- /src/aave/ILendingPool.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/aave/ILendingPool.sol -------------------------------------------------------------------------------- /src/aave/ILendingPoolAddressesProvider.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/aave/ILendingPoolAddressesProvider.sol -------------------------------------------------------------------------------- /src/interfaces/IFactory.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/IFactory.sol -------------------------------------------------------------------------------- /src/interfaces/IPool.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/IPool.sol -------------------------------------------------------------------------------- /src/interfaces/callback/ISwapCallback.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/callback/ISwapCallback.sol -------------------------------------------------------------------------------- /src/interfaces/periphery/IBasePositionManager.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/periphery/IBasePositionManager.sol -------------------------------------------------------------------------------- /src/interfaces/periphery/IERC721Permit.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/periphery/IERC721Permit.sol -------------------------------------------------------------------------------- /src/interfaces/periphery/IRouter.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/periphery/IRouter.sol -------------------------------------------------------------------------------- /src/interfaces/periphery/IRouterTokenHelper.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/periphery/IRouterTokenHelper.sol -------------------------------------------------------------------------------- /src/interfaces/periphery/base_position_manager/IBasePositionManagerEvents.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/periphery/base_position_manager/IBasePositionManagerEvents.sol -------------------------------------------------------------------------------- /src/interfaces/pool/IPoolActions.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/pool/IPoolActions.sol -------------------------------------------------------------------------------- /src/interfaces/pool/IPoolEvents.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/pool/IPoolEvents.sol -------------------------------------------------------------------------------- /src/interfaces/pool/IPoolStorage.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/interfaces/pool/IPoolStorage.sol -------------------------------------------------------------------------------- /src/libraries/FullMath.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/FullMath.sol -------------------------------------------------------------------------------- /src/libraries/MathConstants.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/MathConstants.sol -------------------------------------------------------------------------------- /src/libraries/QtyDeltaMath.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/QtyDeltaMath.sol -------------------------------------------------------------------------------- /src/libraries/QuadMath.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/QuadMath.sol -------------------------------------------------------------------------------- /src/libraries/SafeCast.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/SafeCast.sol -------------------------------------------------------------------------------- /src/libraries/SwapMath.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/SwapMath.sol -------------------------------------------------------------------------------- /src/libraries/TickMath.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/src/libraries/TickMath.sol -------------------------------------------------------------------------------- /test/KyberswapLegacyTest.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/test/KyberswapLegacyTest.sol -------------------------------------------------------------------------------- /test/KyberswapTest.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/test/KyberswapTest.sol -------------------------------------------------------------------------------- /test/Strings.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/one-hundred-proof/kyberswap-exploit/HEAD/test/Strings.sol --------------------------------------------------------------------------------