From 42daa56edc118e04ee9b59539465e12b11fd43ae Mon Sep 17 00:00:00 2001 From: Matthias Zimmermann Date: Mon, 23 Dec 2024 08:40:17 +0000 Subject: [PATCH] run forge fmt --- cache/solidity-files-cache.json | 2 +- src/AccountingToken.sol | 31 +++++++++++++++---------- src/CropProduct.sol | 41 +++++++-------------------------- src/StrHelper.sol | 4 +--- src/Types.sol | 5 ++++ 5 files changed, 34 insertions(+), 49 deletions(-) diff --git a/cache/solidity-files-cache.json b/cache/solidity-files-cache.json index 75a9220..1f6b667 100644 --- a/cache/solidity-files-cache.json +++ b/cache/solidity-files-cache.json @@ -1 +1 @@ -{"_format":"","paths":{"artifacts":"out","build_infos":"out/build-info","sources":"src","tests":"test","scripts":"script","libraries":["lib"]},"files":{"lib/forge-std/src/Base.sol":{"lastModificationDate":1734782986592,"contentHash":"ee13c050b1914464f1d3f90cde90204b","sourceName":"lib/forge-std/src/Base.sol","imports":["lib/forge-std/src/StdStorage.sol","lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"CommonBase":{"0.8.27":{"default":{"path":"Base.sol/CommonBase.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"ScriptBase":{"0.8.27":{"default":{"path":"Base.sol/ScriptBase.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"TestBase":{"0.8.27":{"default":{"path":"Base.sol/TestBase.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/Script.sol":{"lastModificationDate":1734782986593,"contentHash":"ba325c778a7da8a21c2136aa32763c14","sourceName":"lib/forge-std/src/Script.sol","imports":["lib/forge-std/src/Base.sol","lib/forge-std/src/StdChains.sol","lib/forge-std/src/StdCheats.sol","lib/forge-std/src/StdJson.sol","lib/forge-std/src/StdMath.sol","lib/forge-std/src/StdStorage.sol","lib/forge-std/src/StdStyle.sol","lib/forge-std/src/StdUtils.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol","lib/forge-std/src/safeconsole.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"Script":{"0.8.27":{"default":{"path":"Script.sol/Script.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdChains.sol":{"lastModificationDate":1734782986594,"contentHash":"b039727c96bb3d5b9a59448fd16b1e0f","sourceName":"lib/forge-std/src/StdChains.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdChains":{"0.8.27":{"default":{"path":"StdChains.sol/StdChains.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdCheats.sol":{"lastModificationDate":1734782986594,"contentHash":"3fd55234bae5fbb1510bf43268a9d781","sourceName":"lib/forge-std/src/StdCheats.sol","imports":["lib/forge-std/src/StdStorage.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdCheats":{"0.8.27":{"default":{"path":"StdCheats.sol/StdCheats.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"StdCheatsSafe":{"0.8.27":{"default":{"path":"StdCheats.sol/StdCheatsSafe.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdJson.sol":{"lastModificationDate":1734782986595,"contentHash":"02209da5708eaee03e24a9c24a687370","sourceName":"lib/forge-std/src/StdJson.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.0, <0.9.0","artifacts":{"stdJson":{"0.8.27":{"default":{"path":"StdJson.sol/stdJson.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdMath.sol":{"lastModificationDate":1734782986595,"contentHash":"9da8f453eba6bb98f3d75bc6822bfb29","sourceName":"lib/forge-std/src/StdMath.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"stdMath":{"0.8.27":{"default":{"path":"StdMath.sol/stdMath.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdStorage.sol":{"lastModificationDate":1734782986596,"contentHash":"ce68f6e336944f16d31351a47d0b19b8","sourceName":"lib/forge-std/src/StdStorage.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"stdStorage":{"0.8.27":{"default":{"path":"StdStorage.sol/stdStorage.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"stdStorageSafe":{"0.8.27":{"default":{"path":"StdStorage.sol/stdStorageSafe.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdStyle.sol":{"lastModificationDate":1734782986596,"contentHash":"6281165a12aa639705c691fccefd855e","sourceName":"lib/forge-std/src/StdStyle.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.4.22, <0.9.0","artifacts":{"StdStyle":{"0.8.27":{"default":{"path":"StdStyle.sol/StdStyle.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdUtils.sol":{"lastModificationDate":1734782986596,"contentHash":"b50717f17f251a2a96a5884c90add7bf","sourceName":"lib/forge-std/src/StdUtils.sol","imports":["lib/forge-std/src/Vm.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdUtils":{"0.8.27":{"default":{"path":"StdUtils.sol/StdUtils.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/Vm.sol":{"lastModificationDate":1734782986597,"contentHash":"500473737c1f2c0908ce8ae528afc5e6","sourceName":"lib/forge-std/src/Vm.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"Vm":{"0.8.27":{"default":{"path":"Vm.sol/Vm.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"VmSafe":{"0.8.27":{"default":{"path":"Vm.sol/VmSafe.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/console.sol":{"lastModificationDate":1734782986598,"contentHash":"ce19a9e49945b42118379ff99d853c05","sourceName":"lib/forge-std/src/console.sol","imports":[],"versionRequirement":">=0.4.22, <0.9.0","artifacts":{"console":{"0.8.27":{"default":{"path":"console.sol/console.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/console2.sol":{"lastModificationDate":1734782986598,"contentHash":"f65ad21034b111e70fb5342d5771efcd","sourceName":"lib/forge-std/src/console2.sol","imports":["lib/forge-std/src/console.sol"],"versionRequirement":">=0.4.22, <0.9.0","artifacts":{},"seenByCompiler":true},"lib/forge-std/src/interfaces/IERC165.sol":{"lastModificationDate":1734782986599,"contentHash":"90fe5e2e3ed432d6f3b408e7c9e8a739","sourceName":"lib/forge-std/src/interfaces/IERC165.sol","imports":[],"versionRequirement":">=0.6.2","artifacts":{"IERC165":{"0.8.27":{"default":{"path":"IERC165.sol/IERC165.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/interfaces/IERC20.sol":{"lastModificationDate":1734782986599,"contentHash":"8099161d518e5862a76750349d58e801","sourceName":"lib/forge-std/src/interfaces/IERC20.sol","imports":[],"versionRequirement":">=0.6.2","artifacts":{"IERC20":{"0.8.27":{"default":{"path":"IERC20.sol/IERC20.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/interfaces/IERC721.sol":{"lastModificationDate":1734782986600,"contentHash":"efc26e7f9a2f76b68088c8760ceae2dc","sourceName":"lib/forge-std/src/interfaces/IERC721.sol","imports":["lib/forge-std/src/interfaces/IERC165.sol"],"versionRequirement":">=0.6.2","artifacts":{"IERC721":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"IERC721Enumerable":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721Enumerable.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"IERC721Metadata":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721Metadata.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}},"IERC721TokenReceiver":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721TokenReceiver.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/interfaces/IMulticall3.sol":{"lastModificationDate":1734782986600,"contentHash":"7b131ca1ca32ef6378b7b9ad5488b901","sourceName":"lib/forge-std/src/interfaces/IMulticall3.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"IMulticall3":{"0.8.27":{"default":{"path":"IMulticall3.sol/IMulticall3.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/mocks/MockERC20.sol":{"lastModificationDate":1734782986601,"contentHash":"8e14d63e81e1d54dbc2d44df38ae9dec","sourceName":"lib/forge-std/src/mocks/MockERC20.sol","imports":["lib/forge-std/src/interfaces/IERC20.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"MockERC20":{"0.8.27":{"default":{"path":"MockERC20.sol/MockERC20.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/mocks/MockERC721.sol":{"lastModificationDate":1734782986601,"contentHash":"e91cd9dba7f88f03710c56a347d89d1e","sourceName":"lib/forge-std/src/mocks/MockERC721.sol","imports":["lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC721.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"MockERC721":{"0.8.27":{"default":{"path":"MockERC721.sol/MockERC721.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/safeconsole.sol":{"lastModificationDate":1734782986604,"contentHash":"1445aa2f47000e212173e0cefd6c7a77","sourceName":"lib/forge-std/src/safeconsole.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"safeconsole":{"0.8.27":{"default":{"path":"safeconsole.sol/safeconsole.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"script/MockSetup.s.sol":{"lastModificationDate":1734821182617,"contentHash":"440a0bbde6af2fe04d25fc6a53d2b9c4","sourceName":"script/MockSetup.s.sol","imports":["lib/forge-std/src/Base.sol","lib/forge-std/src/Script.sol","lib/forge-std/src/StdChains.sol","lib/forge-std/src/StdCheats.sol","lib/forge-std/src/StdJson.sol","lib/forge-std/src/StdMath.sol","lib/forge-std/src/StdStorage.sol","lib/forge-std/src/StdStyle.sol","lib/forge-std/src/StdUtils.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol","lib/forge-std/src/safeconsole.sol","src/AccountingToken.sol","src/CropProduct.sol","src/Types.sol"],"versionRequirement":"^0.8.13","artifacts":{"MocksSetupScript":{"0.8.27":{"default":{"path":"MockSetup.s.sol/MocksSetupScript.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"src/AccountingToken.sol":{"lastModificationDate":1734785561425,"contentHash":"0783af1bb03f21440a70056518429000","sourceName":"src/AccountingToken.sol","imports":[],"versionRequirement":"^0.8.20","artifacts":{"AccountingToken":{"0.8.27":{"default":{"path":"AccountingToken.sol/AccountingToken.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"src/CropProduct.sol":{"lastModificationDate":1734820210301,"contentHash":"150a524ed4b7e5c5623bcee6b58d6080","sourceName":"src/CropProduct.sol","imports":["src/Types.sol"],"versionRequirement":"^0.8.20","artifacts":{"CropProduct":{"0.8.27":{"default":{"path":"CropProduct.sol/CropProduct.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"src/StrHelper.sol":{"lastModificationDate":1734793035165,"contentHash":"f94dc91aac319cfe07eaba74584dc83d","sourceName":"src/StrHelper.sol","imports":[],"versionRequirement":"^0.8.20","artifacts":{"StrHelper":{"0.8.27":{"default":{"path":"StrHelper.sol/StrHelper.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"src/Types.sol":{"lastModificationDate":1734817037134,"contentHash":"3d38fc63451caaea28ffb7327b813814","sourceName":"src/Types.sol","imports":[],"versionRequirement":"^0.8.20","artifacts":{},"seenByCompiler":true}},"builds":["f5f536aad68759d99ce44c2ec623409c"],"profiles":{"default":{"solc":{"optimizer":{"enabled":true,"runs":200},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"*":["abi","evm.bytecode.object","evm.bytecode.sourceMap","evm.bytecode.linkReferences","evm.deployedBytecode.object","evm.deployedBytecode.sourceMap","evm.deployedBytecode.linkReferences","evm.deployedBytecode.immutableReferences","evm.methodIdentifiers","metadata"]}},"evmVersion":"cancun","viaIR":false,"libraries":{}},"vyper":{"evmVersion":"cancun","outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode"]}}}}}} \ No newline at end of file +{"_format":"","paths":{"artifacts":"out","build_infos":"out/build-info","sources":"src","tests":"test","scripts":"script","libraries":["lib"]},"files":{"lib/forge-std/src/Base.sol":{"lastModificationDate":1734782986592,"contentHash":"ee13c050b1914464f1d3f90cde90204b","sourceName":"lib/forge-std/src/Base.sol","imports":["lib/forge-std/src/StdStorage.sol","lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"CommonBase":{"0.8.27":{"default":{"path":"Base.sol/CommonBase.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"ScriptBase":{"0.8.27":{"default":{"path":"Base.sol/ScriptBase.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"TestBase":{"0.8.27":{"default":{"path":"Base.sol/TestBase.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/Script.sol":{"lastModificationDate":1734782986593,"contentHash":"ba325c778a7da8a21c2136aa32763c14","sourceName":"lib/forge-std/src/Script.sol","imports":["lib/forge-std/src/Base.sol","lib/forge-std/src/StdChains.sol","lib/forge-std/src/StdCheats.sol","lib/forge-std/src/StdJson.sol","lib/forge-std/src/StdMath.sol","lib/forge-std/src/StdStorage.sol","lib/forge-std/src/StdStyle.sol","lib/forge-std/src/StdUtils.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol","lib/forge-std/src/safeconsole.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"Script":{"0.8.27":{"default":{"path":"Script.sol/Script.json","build_id":"f5f536aad68759d99ce44c2ec623409c"}}}},"seenByCompiler":true},"lib/forge-std/src/StdAssertions.sol":{"lastModificationDate":1734782986593,"contentHash":"25b77f9806b64d497b8a46aeb8e5f6f0","sourceName":"lib/forge-std/src/StdAssertions.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdAssertions":{"0.8.27":{"default":{"path":"StdAssertions.sol/StdAssertions.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdChains.sol":{"lastModificationDate":1734782986594,"contentHash":"b039727c96bb3d5b9a59448fd16b1e0f","sourceName":"lib/forge-std/src/StdChains.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdChains":{"0.8.27":{"default":{"path":"StdChains.sol/StdChains.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdCheats.sol":{"lastModificationDate":1734782986594,"contentHash":"3fd55234bae5fbb1510bf43268a9d781","sourceName":"lib/forge-std/src/StdCheats.sol","imports":["lib/forge-std/src/StdStorage.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdCheats":{"0.8.27":{"default":{"path":"StdCheats.sol/StdCheats.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"StdCheatsSafe":{"0.8.27":{"default":{"path":"StdCheats.sol/StdCheatsSafe.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdError.sol":{"lastModificationDate":1734782986594,"contentHash":"64c896e1276a291776e5ea5aecb3870a","sourceName":"lib/forge-std/src/StdError.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"stdError":{"0.8.27":{"default":{"path":"StdError.sol/stdError.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdInvariant.sol":{"lastModificationDate":1734782986594,"contentHash":"f16837d0e7cb829544ae1f1319ea7643","sourceName":"lib/forge-std/src/StdInvariant.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdInvariant":{"0.8.27":{"default":{"path":"StdInvariant.sol/StdInvariant.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdJson.sol":{"lastModificationDate":1734782986595,"contentHash":"02209da5708eaee03e24a9c24a687370","sourceName":"lib/forge-std/src/StdJson.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.0, <0.9.0","artifacts":{"stdJson":{"0.8.27":{"default":{"path":"StdJson.sol/stdJson.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdMath.sol":{"lastModificationDate":1734782986595,"contentHash":"9da8f453eba6bb98f3d75bc6822bfb29","sourceName":"lib/forge-std/src/StdMath.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"stdMath":{"0.8.27":{"default":{"path":"StdMath.sol/stdMath.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdStorage.sol":{"lastModificationDate":1734782986596,"contentHash":"ce68f6e336944f16d31351a47d0b19b8","sourceName":"lib/forge-std/src/StdStorage.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"stdStorage":{"0.8.27":{"default":{"path":"StdStorage.sol/stdStorage.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"stdStorageSafe":{"0.8.27":{"default":{"path":"StdStorage.sol/stdStorageSafe.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdStyle.sol":{"lastModificationDate":1734782986596,"contentHash":"6281165a12aa639705c691fccefd855e","sourceName":"lib/forge-std/src/StdStyle.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.4.22, <0.9.0","artifacts":{"StdStyle":{"0.8.27":{"default":{"path":"StdStyle.sol/StdStyle.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdToml.sol":{"lastModificationDate":1734782986596,"contentHash":"4bce85a4c60f2c073e651ee8140bcb4d","sourceName":"lib/forge-std/src/StdToml.sol","imports":["lib/forge-std/src/Vm.sol"],"versionRequirement":">=0.6.0, <0.9.0","artifacts":{"stdToml":{"0.8.27":{"default":{"path":"StdToml.sol/stdToml.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/StdUtils.sol":{"lastModificationDate":1734782986596,"contentHash":"b50717f17f251a2a96a5884c90add7bf","sourceName":"lib/forge-std/src/StdUtils.sol","imports":["lib/forge-std/src/Vm.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"StdUtils":{"0.8.27":{"default":{"path":"StdUtils.sol/StdUtils.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/Test.sol":{"lastModificationDate":1734782986596,"contentHash":"b6f15605355fc8c421fe42a90f94bf32","sourceName":"lib/forge-std/src/Test.sol","imports":["lib/forge-std/src/Base.sol","lib/forge-std/src/StdAssertions.sol","lib/forge-std/src/StdChains.sol","lib/forge-std/src/StdCheats.sol","lib/forge-std/src/StdError.sol","lib/forge-std/src/StdInvariant.sol","lib/forge-std/src/StdJson.sol","lib/forge-std/src/StdMath.sol","lib/forge-std/src/StdStorage.sol","lib/forge-std/src/StdStyle.sol","lib/forge-std/src/StdToml.sol","lib/forge-std/src/StdUtils.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol","lib/forge-std/src/safeconsole.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"Test":{"0.8.27":{"default":{"path":"Test.sol/Test.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/Vm.sol":{"lastModificationDate":1734782986597,"contentHash":"500473737c1f2c0908ce8ae528afc5e6","sourceName":"lib/forge-std/src/Vm.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"Vm":{"0.8.27":{"default":{"path":"Vm.sol/Vm.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"VmSafe":{"0.8.27":{"default":{"path":"Vm.sol/VmSafe.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/console.sol":{"lastModificationDate":1734782986598,"contentHash":"ce19a9e49945b42118379ff99d853c05","sourceName":"lib/forge-std/src/console.sol","imports":[],"versionRequirement":">=0.4.22, <0.9.0","artifacts":{"console":{"0.8.27":{"default":{"path":"console.sol/console.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/console2.sol":{"lastModificationDate":1734782986598,"contentHash":"f65ad21034b111e70fb5342d5771efcd","sourceName":"lib/forge-std/src/console2.sol","imports":["lib/forge-std/src/console.sol"],"versionRequirement":">=0.4.22, <0.9.0","artifacts":{},"seenByCompiler":true},"lib/forge-std/src/interfaces/IERC165.sol":{"lastModificationDate":1734782986599,"contentHash":"90fe5e2e3ed432d6f3b408e7c9e8a739","sourceName":"lib/forge-std/src/interfaces/IERC165.sol","imports":[],"versionRequirement":">=0.6.2","artifacts":{"IERC165":{"0.8.27":{"default":{"path":"IERC165.sol/IERC165.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/interfaces/IERC20.sol":{"lastModificationDate":1734782986599,"contentHash":"8099161d518e5862a76750349d58e801","sourceName":"lib/forge-std/src/interfaces/IERC20.sol","imports":[],"versionRequirement":">=0.6.2","artifacts":{"IERC20":{"0.8.27":{"default":{"path":"IERC20.sol/IERC20.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/interfaces/IERC721.sol":{"lastModificationDate":1734782986600,"contentHash":"efc26e7f9a2f76b68088c8760ceae2dc","sourceName":"lib/forge-std/src/interfaces/IERC721.sol","imports":["lib/forge-std/src/interfaces/IERC165.sol"],"versionRequirement":">=0.6.2","artifacts":{"IERC721":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"IERC721Enumerable":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721Enumerable.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"IERC721Metadata":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721Metadata.json","build_id":"621964577cbadb43cdf3befecfa29848"}}},"IERC721TokenReceiver":{"0.8.27":{"default":{"path":"IERC721.sol/IERC721TokenReceiver.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/interfaces/IMulticall3.sol":{"lastModificationDate":1734782986600,"contentHash":"7b131ca1ca32ef6378b7b9ad5488b901","sourceName":"lib/forge-std/src/interfaces/IMulticall3.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"IMulticall3":{"0.8.27":{"default":{"path":"IMulticall3.sol/IMulticall3.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/mocks/MockERC20.sol":{"lastModificationDate":1734782986601,"contentHash":"8e14d63e81e1d54dbc2d44df38ae9dec","sourceName":"lib/forge-std/src/mocks/MockERC20.sol","imports":["lib/forge-std/src/interfaces/IERC20.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"MockERC20":{"0.8.27":{"default":{"path":"MockERC20.sol/MockERC20.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/mocks/MockERC721.sol":{"lastModificationDate":1734782986601,"contentHash":"e91cd9dba7f88f03710c56a347d89d1e","sourceName":"lib/forge-std/src/mocks/MockERC721.sol","imports":["lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC721.sol"],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"MockERC721":{"0.8.27":{"default":{"path":"MockERC721.sol/MockERC721.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"lib/forge-std/src/safeconsole.sol":{"lastModificationDate":1734782986604,"contentHash":"1445aa2f47000e212173e0cefd6c7a77","sourceName":"lib/forge-std/src/safeconsole.sol","imports":[],"versionRequirement":">=0.6.2, <0.9.0","artifacts":{"safeconsole":{"0.8.27":{"default":{"path":"safeconsole.sol/safeconsole.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"src/AccountingToken.sol":{"lastModificationDate":1734943199563,"contentHash":"31062525ec7cdc9fcb0539bf0afd6b9c","sourceName":"src/AccountingToken.sol","imports":[],"versionRequirement":"^0.8.20","artifacts":{"AccountingToken":{"0.8.27":{"default":{"path":"AccountingToken.sol/AccountingToken.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"src/CropProduct.sol":{"lastModificationDate":1734943199533,"contentHash":"755470df55bb3935564b1dabe033e24a","sourceName":"src/CropProduct.sol","imports":["src/Types.sol"],"versionRequirement":"^0.8.20","artifacts":{"CropProduct":{"0.8.27":{"default":{"path":"CropProduct.sol/CropProduct.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"src/StrHelper.sol":{"lastModificationDate":1734943199543,"contentHash":"41343aebeb528107414c8c0fae2802b8","sourceName":"src/StrHelper.sol","imports":[],"versionRequirement":"^0.8.20","artifacts":{"StrHelper":{"0.8.27":{"default":{"path":"StrHelper.sol/StrHelper.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"src/Types.sol":{"lastModificationDate":1734943199561,"contentHash":"4bed7a1cf8422304e3158d1e696eb38e","sourceName":"src/Types.sol","imports":[],"versionRequirement":"^0.8.20","artifacts":{},"seenByCompiler":true},"test/AccountingToken.t.sol":{"lastModificationDate":1734821047955,"contentHash":"7678112bf89dc6b997249dfe7a6a7f00","sourceName":"test/AccountingToken.t.sol","imports":["lib/forge-std/src/Base.sol","lib/forge-std/src/StdAssertions.sol","lib/forge-std/src/StdChains.sol","lib/forge-std/src/StdCheats.sol","lib/forge-std/src/StdError.sol","lib/forge-std/src/StdInvariant.sol","lib/forge-std/src/StdJson.sol","lib/forge-std/src/StdMath.sol","lib/forge-std/src/StdStorage.sol","lib/forge-std/src/StdStyle.sol","lib/forge-std/src/StdToml.sol","lib/forge-std/src/StdUtils.sol","lib/forge-std/src/Test.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol","lib/forge-std/src/safeconsole.sol","src/AccountingToken.sol"],"versionRequirement":"^0.8.13","artifacts":{"AccountingTokenTest":{"0.8.27":{"default":{"path":"AccountingToken.t.sol/AccountingTokenTest.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true},"test/CropProduct.t.sol":{"lastModificationDate":1734821142941,"contentHash":"e1fb5dc44b98bdd435f8da2d5aa7e589","sourceName":"test/CropProduct.t.sol","imports":["lib/forge-std/src/Base.sol","lib/forge-std/src/StdAssertions.sol","lib/forge-std/src/StdChains.sol","lib/forge-std/src/StdCheats.sol","lib/forge-std/src/StdError.sol","lib/forge-std/src/StdInvariant.sol","lib/forge-std/src/StdJson.sol","lib/forge-std/src/StdMath.sol","lib/forge-std/src/StdStorage.sol","lib/forge-std/src/StdStyle.sol","lib/forge-std/src/StdToml.sol","lib/forge-std/src/StdUtils.sol","lib/forge-std/src/Test.sol","lib/forge-std/src/Vm.sol","lib/forge-std/src/console.sol","lib/forge-std/src/console2.sol","lib/forge-std/src/interfaces/IERC165.sol","lib/forge-std/src/interfaces/IERC20.sol","lib/forge-std/src/interfaces/IERC721.sol","lib/forge-std/src/interfaces/IMulticall3.sol","lib/forge-std/src/mocks/MockERC20.sol","lib/forge-std/src/mocks/MockERC721.sol","lib/forge-std/src/safeconsole.sol","src/CropProduct.sol","src/Types.sol"],"versionRequirement":"^0.8.13","artifacts":{"CropProductTest":{"0.8.27":{"default":{"path":"CropProduct.t.sol/CropProductTest.json","build_id":"621964577cbadb43cdf3befecfa29848"}}}},"seenByCompiler":true}},"builds":["621964577cbadb43cdf3befecfa29848","f5f536aad68759d99ce44c2ec623409c"],"profiles":{"default":{"solc":{"optimizer":{"enabled":true,"runs":200},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"*":["abi","evm.bytecode.object","evm.bytecode.sourceMap","evm.bytecode.linkReferences","evm.deployedBytecode.object","evm.deployedBytecode.sourceMap","evm.deployedBytecode.linkReferences","evm.deployedBytecode.immutableReferences","evm.methodIdentifiers","metadata"]}},"evmVersion":"cancun","viaIR":false,"libraries":{}},"vyper":{"evmVersion":"cancun","outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode"]}}}}}} \ No newline at end of file diff --git a/src/AccountingToken.sol b/src/AccountingToken.sol index cb3d622..07e748a 100644 --- a/src/AccountingToken.sol +++ b/src/AccountingToken.sol @@ -2,26 +2,27 @@ pragma solidity ^0.8.20; contract AccountingToken { - string public constant NAME = "Local Currency (Accounting Token)"; string public constant SYMBOL = "LCA"; uint8 public constant DECIMALS = 6; - uint256 public constant INITIAL_SUPPLY = 10**12 * 10**DECIMALS; + uint256 public constant INITIAL_SUPPLY = 10 ** 12 * 10 ** DECIMALS; mapping(address => uint256) internal _balanceOf; mapping(address => mapping(address => uint256)) internal _allowance; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); - + constructor() { _balanceOf[msg.sender] = INITIAL_SUPPLY; emit Transfer(address(0), msg.sender, INITIAL_SUPPLY); } - function totalSupply() external view returns (uint256) { return INITIAL_SUPPLY; } + function totalSupply() external view returns (uint256) { + return INITIAL_SUPPLY; + } - function balanceOf(address account) external view returns (uint256) { + function balanceOf(address account) external view returns (uint256) { return _balanceOf[account]; } @@ -29,17 +30,17 @@ contract AccountingToken { require(_balanceOf[msg.sender] >= value, "Insufficient balance"); _balanceOf[msg.sender] -= value; _balanceOf[to] += value; - emit Transfer(msg.sender,to,value); + emit Transfer(msg.sender, to, value); return true; } function allowance(address owner, address spender) external view returns (uint256) { return _allowance[owner][spender]; - } + } function approve(address spender, uint256 value) external returns (bool) { _allowance[msg.sender][spender] = value; - emit Approval(msg.sender,spender,value); + emit Approval(msg.sender, spender, value); return true; } @@ -49,13 +50,19 @@ contract AccountingToken { _allowance[from][msg.sender] -= value; _balanceOf[from] -= value; _balanceOf[to] += value; - emit Transfer(from,to,value); + emit Transfer(from, to, value); return true; } - function name() external view returns (string memory) { return NAME; } + function name() external view returns (string memory) { + return NAME; + } - function symbol() external view returns (string memory) { return SYMBOL; } + function symbol() external view returns (string memory) { + return SYMBOL; + } - function decimals() public pure returns(uint8) { return DECIMALS; } + function decimals() public pure returns (uint8) { + return DECIMALS; + } } diff --git a/src/CropProduct.sol b/src/CropProduct.sol index f2a135f..5936bce 100644 --- a/src/CropProduct.sol +++ b/src/CropProduct.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.20; import {Amount, Location, NftId, RiskId, Str, Timestamp} from "./Types.sol"; contract CropProduct { - event LogCropPolicyCreated(NftId policyNftId); error StringTooLong(string str); @@ -22,30 +21,13 @@ contract CropProduct { Str seasonStart, // ISO 8601 date, eg "2025-02-18" Str seasonEnd, uint16 seasonDays - ) - external - { } + ) external {} - function createLocation( - Str locationId, - int32 latitude, - int32 longitude - ) - external - returns (Location location) - { } + function createLocation(Str locationId, int32 latitude, int32 longitude) external returns (Location location) {} - function createCrop(Str crop) - external - { } + function createCrop(Str crop) external {} - function createRisk( - Str id, - Str seasonId, - Str locationId, - Str crop, - Timestamp seasonEndAt - ) + function createRisk(Str id, Str seasonId, Str locationId, Str crop, Timestamp seasonEndAt) external returns (RiskId riskId) { @@ -60,10 +42,7 @@ contract CropProduct { Timestamp activateAt, Amount sumInsuredAmount, Amount premiumAmount - ) - external - returns (NftId policyNftId) - { + ) external returns (NftId policyNftId) { policyNftCounter++; policyNftId = NftId.wrap(1000 * policyNftCounter + 101); emit LogCropPolicyCreated(policyNftId); @@ -71,12 +50,8 @@ contract CropProduct { return policyNftId; } - function getRiskId(Str id) - external - view - returns (RiskId riskId) - { - return _riskId[id]; + function getRiskId(Str id) external view returns (RiskId riskId) { + return _riskId[id]; } /// @dev converts the provided string into a short string. @@ -111,4 +86,4 @@ contract CropProduct { } return result; } -} \ No newline at end of file +} diff --git a/src/StrHelper.sol b/src/StrHelper.sol index 90b476b..58ab9f9 100644 --- a/src/StrHelper.sol +++ b/src/StrHelper.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.20; type Str is bytes32; contract StrHelper { - error StringTooLong(string str); error InvalidShortString(); @@ -31,7 +30,6 @@ contract StrHelper { return str; } - /// @dev returns the length of the provided short string. /// code from OZ ShortStrings.byteLength function length(Str sstr) public pure returns (uint256) { @@ -41,4 +39,4 @@ contract StrHelper { } return result; } -} \ No newline at end of file +} diff --git a/src/Types.sol b/src/Types.sol index f12c99c..53ffdd8 100644 --- a/src/Types.sol +++ b/src/Types.sol @@ -2,8 +2,13 @@ pragma solidity ^0.8.20; type Amount is uint96; + type Location is uint64; + type NftId is uint96; + type RiskId is bytes8; + type Str is bytes32; + type Timestamp is uint40;