Compare commits
1431 Commits
v3.0.1
...
formal-ver
| Author | SHA1 | Date | |
|---|---|---|---|
| 37991642dc | |||
| 1038b7f2c7 | |||
| 7dc201fce9 | |||
| bf73fb4013 | |||
| 6c4ffe783f | |||
| f21f86c3c1 | |||
| 2e7bca424a | |||
| d4e9d8d54d | |||
| baf71582b9 | |||
| ecebc5688d | |||
| 3c58e4e3d3 | |||
| 4242fdace4 | |||
| 14b40eddcb | |||
| c8c8ca39d7 | |||
| 150edce57b | |||
| 9f2d511d20 | |||
| b50d9980be | |||
| 423a808748 | |||
| 5c859049e6 | |||
| cad49af31e | |||
| e0fa84a6b7 | |||
| dad73159df | |||
| 2c69f9f9f5 | |||
| 3f3774c5df | |||
| 8b47e96af1 | |||
| 0fbd039554 | |||
| 2c6ef8c875 | |||
| eb38c059d8 | |||
| 8a43ebac28 | |||
| b4d765b130 | |||
| d5581531de | |||
| 62dbb1b06a | |||
| 6e88df28cb | |||
| a6b8366980 | |||
| 9d06a1b64b | |||
| 7b3e7b7055 | |||
| 53235263a3 | |||
| adb861fb3b | |||
| 227473e88c | |||
| df814dd374 | |||
| 1e245aa54b | |||
| 815bfbf383 | |||
| 7ac4349710 | |||
| 08d085f2c9 | |||
| 96a2297e15 | |||
| d64d7aa5d1 | |||
| d5d9d4bd3d | |||
| 5e76b26225 | |||
| 4ff538af58 | |||
| 4e8aa43a90 | |||
| 6d18435098 | |||
| 2c711d0b05 | |||
| 5a00628ed3 | |||
| dfcc1d16c5 | |||
| 6259e13a0c | |||
| 790cc5b65a | |||
| 94cd8ef12e | |||
| 5b027e517e | |||
| d625cb45ea | |||
| 8177c4620e | |||
| 4d3e423443 | |||
| 95027565c4 | |||
| 1575cc6908 | |||
| 260e082ed1 | |||
| 3b591a48ac | |||
| d13ec90f37 | |||
| 132e5aa97b | |||
| 740ce2d440 | |||
| 91e8d0ba3c | |||
| a70ee4e3bb | |||
| 501a78e134 | |||
| 591c12d22d | |||
| 1684c57922 | |||
| bc6de21fe2 | |||
| 5e28952cbd | |||
| 0320a718e8 | |||
| d6fb3d645f | |||
| 69c8d1010e | |||
| a284569a7c | |||
| a34dd8bb1b | |||
| b1c2c43d6a | |||
| c404862cba | |||
| 2a62fb4a2d | |||
| afcdc58419 | |||
| dc1ffa79e7 | |||
| c8b466b7b5 | |||
| 5a0863ccf0 | |||
| 0c89a8b771 | |||
| f81e5f51c1 | |||
| 74b8ae9372 | |||
| c9bc4f8203 | |||
| 88a64a802e | |||
| 18691d1a6f | |||
| 785f65183c | |||
| a5af0adce4 | |||
| d89e51ac42 | |||
| 717fbc45cb | |||
| ac30219a6a | |||
| 42fab12584 | |||
| 6b17b33430 | |||
| 5dbde1a5c9 | |||
| 86de1e8b6c | |||
| d59306bd06 | |||
| a28aafdc85 | |||
| 88754d0b36 | |||
| 2fc24fc8d4 | |||
| 3a3c87b1a6 | |||
| c1d9da4052 | |||
| a81b0d0b21 | |||
| 276b32a5ec | |||
| 4fc19ddb8d | |||
| 0892f877b8 | |||
| a4596cab05 | |||
| ccc175a9ed | |||
| 2336bd3e8e | |||
| cc27aed391 | |||
| bc50d373e3 | |||
| b0db207e4e | |||
| cafe5eb985 | |||
| 8335676b0e | |||
| 96ff934ad0 | |||
| 7a6a9d1516 | |||
| f799475d93 | |||
| 446cd9f5fb | |||
| b709eae01d | |||
| 4072e853fe | |||
| a3b9fac30e | |||
| 3f16692dad | |||
| 6b0c9f4e77 | |||
| 3d7a93876a | |||
| 98967feeb2 | |||
| 206a239448 | |||
| 93cd2ecb73 | |||
| c30fad9955 | |||
| 88fa71ecd5 | |||
| 24d1bb668a | |||
| 4e8b2fa659 | |||
| e04f7ded94 | |||
| 8f8fd84f1e | |||
| 8c9a831596 | |||
| 99589794db | |||
| b2970b96e5 | |||
| 7c5f6bc2c8 | |||
| 49c0e4370d | |||
| e0137d4cbe | |||
| e708b096cf | |||
| 47d4ebb734 | |||
| 634710d795 | |||
| 2c5194f3f1 | |||
| c7315e8779 | |||
| 0b6becd49f | |||
| 88a3f95715 | |||
| 07ac1030e7 | |||
| d5ca39e9a2 | |||
| 16fa1834e5 | |||
| 7d01facdb8 | |||
| 8bfcb65924 | |||
| 8d105825e9 | |||
| 36951d5838 | |||
| f99bc4e0cf | |||
| 25fe191202 | |||
| 014ce9c6e6 | |||
| a1948250ab | |||
| 1f18fea1de | |||
| 1a41a503e0 | |||
| a71caa28e7 | |||
| 3742c16948 | |||
| 08d5e4a9b0 | |||
| 02722fcc03 | |||
| eb03304b70 | |||
| c463b8a67e | |||
| 4e18cdc186 | |||
| 8d908fe2c2 | |||
| 47003aebec | |||
| 34e5863cd5 | |||
| b7aff6363f | |||
| 9a11de924d | |||
| a73d7ab57b | |||
| 89962af163 | |||
| 7201e6707f | |||
| 561d1061fc | |||
| 50501a751e | |||
| f0de978a9e | |||
| 16408a1dcf | |||
| 0b3acb286a | |||
| c52625018b | |||
| c7a544d568 | |||
| 26dddee1c0 | |||
| 634c37becf | |||
| 14f98dbb58 | |||
| 9938a85558 | |||
| d986bbc8e0 | |||
| fed8d5c856 | |||
| 597202d904 | |||
| 8f6a03204e | |||
| c22db8104e | |||
| 2a45f99fc4 | |||
| fb9345814b | |||
| 72bbe63ec7 | |||
| ec88e9d6aa | |||
| ed12acfb0a | |||
| 5e8e8bb9f0 | |||
| 561d0eead3 | |||
| e2362ce74f | |||
| c08c6e1b84 | |||
| 16791134c1 | |||
| 76273ecd8e | |||
| d89a62e0a6 | |||
| 089f9b95af | |||
| 8740d8f7f3 | |||
| 09369d265c | |||
| 1bbdf2005d | |||
| c8a0639afe | |||
| 3f6c8245aa | |||
| 408055dfab | |||
| d916e2edf4 | |||
| 3075181276 | |||
| aa4b901788 | |||
| 8b1042371a | |||
| 8f0d4d4a41 | |||
| 046121e080 | |||
| 06e678d6ef | |||
| 38d21cab86 | |||
| bfbf4d8398 | |||
| 49333bcc24 | |||
| 3252e54f2b | |||
| cc7837fb46 | |||
| 9dd0eb5e5c | |||
| 9ce8455ae0 | |||
| dfa0505c40 | |||
| e7f770591b | |||
| b9c7899e6c | |||
| 0f20d57771 | |||
| 797ef26bb6 | |||
| 9aa745e4fe | |||
| d7c3cc758b | |||
| 3c0d926908 | |||
| 28367f8989 | |||
| 61817e055f | |||
| 94f9f7ac58 | |||
| b2ec06aaf2 | |||
| 0fa6aad5e5 | |||
| 8d3d181207 | |||
| 8769b19860 | |||
| a615329423 | |||
| 7a14f6c595 | |||
| a549ec673e | |||
| 76b538c226 | |||
| 7deed7a769 | |||
| 9416743a10 | |||
| d6975f8e07 | |||
| fac768cd2c | |||
| 0c2453ba17 | |||
| 0d1e919742 | |||
| 75ce9ef8e9 | |||
| 56c355ea8b | |||
| e9f53ebc02 | |||
| 3aa0a015d1 | |||
| d98d9c03f3 | |||
| 5e6fd491f3 | |||
| 6a8d977d22 | |||
| 3c552e6e03 | |||
| 5d31ad0eb9 | |||
| 80ae402387 | |||
| c1d6e39aab | |||
| d857ab5702 | |||
| 42fe56031f | |||
| 171fa40bc8 | |||
| 005a35b02a | |||
| 84fafa7832 | |||
| e09ccd1449 | |||
| a60ae0f18b | |||
| 66ec91bc45 | |||
| 1c3410aa75 | |||
| 1f0e7cdf04 | |||
| 160bf1a6eb | |||
| 1eb55e2864 | |||
| 4b8b92c8bf | |||
| affe2456ea | |||
| 71aaca2d9d | |||
| 4b16e88747 | |||
| 93bc3b657b | |||
| 141130db27 | |||
| e45b49eab8 | |||
| 62bab225c1 | |||
| dc14c72e53 | |||
| 6b9bda872d | |||
| 6d8017d07e | |||
| 24fc709533 | |||
| f491e98d37 | |||
| 98c3a79b57 | |||
| 17bc2dabe0 | |||
| c797195f1d | |||
| 27d4293db6 | |||
| 26cf47a2be | |||
| 397c946141 | |||
| 2d4fb93087 | |||
| 54dec0cad5 | |||
| bbb9a17872 | |||
| 6729fec74a | |||
| 4ae655c368 | |||
| 324eda228c | |||
| 2dc086563f | |||
| 2627753bfe | |||
| 4820ed4ea8 | |||
| 4a3b0bb875 | |||
| 3e6045155e | |||
| 386848174b | |||
| d693d89d99 | |||
| ff16696c9c | |||
| ca6f95a7da | |||
| d514cdd26e | |||
| 85a9bed49e | |||
| ec825d8999 | |||
| ce0068c21e | |||
| bc14f8dc89 | |||
| 7b5ef46371 | |||
| c11acfd9d3 | |||
| ffb0ae76e3 | |||
| dc4869eb23 | |||
| 8ea1fc87c9 | |||
| 0d91b620b7 | |||
| 81336aefb5 | |||
| 7ddbfe181e | |||
| 48dd186870 | |||
| fbf235661e | |||
| d1b1e17d23 | |||
| 6e8d885ca7 | |||
| 0ccfd2dbd3 | |||
| 580b7ab816 | |||
| d3ff81b37f | |||
| 1b1dd0ca2c | |||
| e0149921b8 | |||
| 628a6e2866 | |||
| d50e608a4f | |||
| 6ab8d6a67e | |||
| 3210a8653b | |||
| 96163c87e3 | |||
| 3a1c020b7d | |||
| cfc9f840a0 | |||
| 5e7e9acfa4 | |||
| 8b778fa20d | |||
| e7397844f8 | |||
| e02c378745 | |||
| 597654db00 | |||
| 5fbf494511 | |||
| 7a8f269457 | |||
| 4a194b3a1c | |||
| 3dac7bbed7 | |||
| b159b3fee2 | |||
| e734b42fc2 | |||
| 40172c22d9 | |||
| 6f88199db9 | |||
| e8c60f92e3 | |||
| 2894059775 | |||
| 74738721dc | |||
| 450c569d78 | |||
| 4bf9ab41f8 | |||
| 83277ff916 | |||
| b90f4d285e | |||
| cb3f2ab900 | |||
| 1701b0c7fd | |||
| 154a151518 | |||
| 0b99b54327 | |||
| 9708bc0397 | |||
| 8ec6b0f56f | |||
| 962a5023e6 | |||
| 109778c17c | |||
| ed704d82b3 | |||
| a55b7d1372 | |||
| 5a0bff465d | |||
| 4135bf9707 | |||
| 429b2242d8 | |||
| c10a097fa8 | |||
| cb7dbf8297 | |||
| 6820ff8b9c | |||
| 65ab8e9ac4 | |||
| 9bbc7b7eb3 | |||
| e4492aed8a | |||
| 9c45c52c4b | |||
| ca034ab3df | |||
| 75a3602ba6 | |||
| 7c75b8aa89 | |||
| 08d109d877 | |||
| 3ac4add548 | |||
| 7946806fb3 | |||
| 3aa7ff74b0 | |||
| 994cf9b34b | |||
| f6cd8032ba | |||
| 84b371f92c | |||
| 051cc9e446 | |||
| cccd90ec83 | |||
| ee2f0ecb68 | |||
| 6a4fc6acb8 | |||
| 1aa8141b14 | |||
| 866042d6fc | |||
| 234b843c36 | |||
| a373d25b01 | |||
| f4b2aff79e | |||
| 371818f792 | |||
| 3ccaf4f6d1 | |||
| ffa3daa5d9 | |||
| 990fd18c21 | |||
| 5a7cc50974 | |||
| e3341255b2 | |||
| 69d9ebfcdf | |||
| 54ce38c2e5 | |||
| be18334b69 | |||
| 5516589b88 | |||
| 6363deaedd | |||
| b10a2b8cd3 | |||
| d506e3b1a5 | |||
| bdb49654c5 | |||
| bab9528dc1 | |||
| 93928e3e19 | |||
| 113443470c | |||
| 35090c1bf1 | |||
| 04204b8fb9 | |||
| f3f26e3ff3 | |||
| 3eb67081f3 | |||
| d02c2ccab3 | |||
| 27fa53bba9 | |||
| b90d195c6c | |||
| a6863a059c | |||
| 5e00787199 | |||
| 669a22e0ff | |||
| cab8e489b2 | |||
| 62f2c0531b | |||
| 4fc9fd3efe | |||
| 6d00281593 | |||
| 2b0b0bb186 | |||
| 0119a187c1 | |||
| 15e847c835 | |||
| 8e283704c3 | |||
| 38495a5026 | |||
| f74e316422 | |||
| 2a73da9f67 | |||
| 018c58219f | |||
| bd3427d5ff | |||
| 10f5d8d942 | |||
| 6766b2de3b | |||
| 4942bd19e2 | |||
| b2cdcc38d4 | |||
| ca0d3363b8 | |||
| 82a63f6389 | |||
| 488dd562fb | |||
| 78263e2a9a | |||
| 4dc0ff9fe3 | |||
| 1dd3b7a307 | |||
| 657a051062 | |||
| da1cda69bf | |||
| 428197be69 | |||
| 5e69b54af1 | |||
| 04382cd1d3 | |||
| d01f3ba925 | |||
| 94eba74016 | |||
| 8ec6785cb8 | |||
| 61294a62af | |||
| f8157ac854 | |||
| 0321f38054 | |||
| 65b45726b3 | |||
| c019e7c5bb | |||
| 36327ce8c5 | |||
| 39f29ec3fd | |||
| 7a2b502b9c | |||
| de74c8c62c | |||
| b61faf8368 | |||
| 46cb74f3cf | |||
| c4f76cfa15 | |||
| fa89068f2b | |||
| 6339027a7a | |||
| 46db8a98b0 | |||
| c2077f0034 | |||
| ee4d8380d3 | |||
| 793b88efd8 | |||
| 5772512058 | |||
| cd2da98d4d | |||
| e633ee9ed3 | |||
| c45f34adc8 | |||
| 6add1e7718 | |||
| 0deaee1217 | |||
| 2fc3a5d4b8 | |||
| da0fdc1aa0 | |||
| 3bdf4bfd29 | |||
| 3b9381dfb1 | |||
| aafb14461b | |||
| 70cbfffc74 | |||
| 4a3cddc529 | |||
| 07b1b472c0 | |||
| 4574ce45b6 | |||
| 5ed20f32cf | |||
| 14ca3aeb79 | |||
| 1d2ab4f41c | |||
| be3cfa0f90 | |||
| fcf35e5722 | |||
| a035b235b4 | |||
| 848fef5b6c | |||
| 85627ffa91 | |||
| c12076fb7e | |||
| d4e6236b2b | |||
| 5a75065659 | |||
| cb14ea3c5c | |||
| cca337f5ae | |||
| 02de598056 | |||
| 8fc90f6779 | |||
| f15308f763 | |||
| f242abbf93 | |||
| 135e21f35d | |||
| 6662d0556f | |||
| 7392d83738 | |||
| d1454932b2 | |||
| cab9b09b7b | |||
| 28dd490726 | |||
| bc810db320 | |||
| 741e9a8b6d | |||
| 66c72f2b5d | |||
| 163a76f436 | |||
| 75417fbf9f | |||
| dd01889434 | |||
| 731e199038 | |||
| ec8f03ee96 | |||
| 140df5b7ce | |||
| d4d8d2ed97 | |||
| f81b80fb39 | |||
| 3fb25b604b | |||
| da674eced1 | |||
| 479118fcd1 | |||
| 8c86b250bc | |||
| a0b58c3071 | |||
| 742e85be7c | |||
| fe7d42dedd | |||
| 44fba3e2eb | |||
| 69c3781043 | |||
| 0762479dd5 | |||
| 049701eacd | |||
| b2b72e7783 | |||
| 22827223c0 | |||
| f85eb5b725 | |||
| 033f08972f | |||
| ec4e77397f | |||
| 50cf82823e | |||
| 53b6ed80bb | |||
| a982bee235 | |||
| 9af5af8fff | |||
| d2832ca7a9 | |||
| 2bd75a44bb | |||
| 2a4ca65404 | |||
| 92f07bae1b | |||
| 3f49408fb6 | |||
| e7719ded56 | |||
| 668a648bc6 | |||
| 02fcc75bb7 | |||
| ae270b0d89 | |||
| 4c74b2951d | |||
| 3f1ee39910 | |||
| e029096ca4 | |||
| 4b9500cf25 | |||
| a35ad6dfc3 | |||
| 140f019155 | |||
| 6895946f41 | |||
| 76eee35971 | |||
| bfff03c0d2 | |||
| 76fca3aec8 | |||
| 5153c462d5 | |||
| 8318470cca | |||
| 74c9130a59 | |||
| 15d5174139 | |||
| 05077f70f1 | |||
| faf5820f03 | |||
| 0eba5112c8 | |||
| b13bdb0249 | |||
| c028c56965 | |||
| 98716177ae | |||
| 89f9878ba2 | |||
| 6c5d33ba22 | |||
| 8d9ab176d7 | |||
| 62d60a5890 | |||
| 52eeebecda | |||
| 6a5bbfc4cb | |||
| 7caa9bbb2c | |||
| 8372b4f923 | |||
| cc1c18098c | |||
| c72281ea45 | |||
| 2be84e627b | |||
| f2a311dc4a | |||
| 8b162e39b5 | |||
| 62eb4568be | |||
| 1900c86c99 | |||
| f8bfa560e9 | |||
| 56e4ae9f4a | |||
| 212221d6ff | |||
| 3cb87abec1 | |||
| b3845e43d8 | |||
| 61fa061ecf | |||
| c239e1af8d | |||
| f590fcdfe9 | |||
| ef8013ef79 | |||
| 9bded169e8 | |||
| 7ab95baab8 | |||
| dc739dcbe3 | |||
| fd07cc6290 | |||
| 99864fd2da | |||
| 1c3b17826e | |||
| f9d9279320 | |||
| abdb20a6bd | |||
| 3e74681e77 | |||
| f6b614a7c5 | |||
| 458697be32 | |||
| af7ec04b78 | |||
| eae2384178 | |||
| 6db2d0ea39 | |||
| 3fe65ef467 | |||
| 525a672862 | |||
| aace774961 | |||
| 6fec54f17f | |||
| 58f635312a | |||
| 3dfc0a44f8 | |||
| be3c5ca504 | |||
| 4cb0926f11 | |||
| 5b6112000c | |||
| afb20119b3 | |||
| 718d0ba2a1 | |||
| 591e30b7b6 | |||
| 24f561a9a1 | |||
| 32b4eee9a3 | |||
| c5a6cae898 | |||
| 63b466901f | |||
| defcf20042 | |||
| b119b564df | |||
| 28986d2f2e | |||
| 85566faeb2 | |||
| bfd05d9646 | |||
| 574f3b89e1 | |||
| ca755ce799 | |||
| fc01c51c13 | |||
| 21c5d623d6 | |||
| 4f8af2dceb | |||
| a81b07ce91 | |||
| f55d2716a8 | |||
| ae54e6de1d | |||
| fb950c6166 | |||
| 6fb1e843cf | |||
| 78deae5a76 | |||
| e298476a90 | |||
| a5e042cedf | |||
| d57593c148 | |||
| 7c47ac7193 | |||
| 8f70c8867e | |||
| b3b83b558e | |||
| 783ac759a9 | |||
| 25eeb80b18 | |||
| 3eb2d43b06 | |||
| ecae978cb5 | |||
| e192fac276 | |||
| 3458c1e854 | |||
| dee772a55f | |||
| 1051db3802 | |||
| a8f35b6c25 | |||
| c366de3626 | |||
| 80d8da0564 | |||
| fd7c4ba8f0 | |||
| 8dd744fc18 | |||
| 828fe365ee | |||
| a65c03bc0d | |||
| 1e815f3308 | |||
| d74605641c | |||
| a9f994f063 | |||
| ef0273fde1 | |||
| da3a9ae18b | |||
| e3391cd65f | |||
| e9e177f53b | |||
| fe38eae6cd | |||
| 915ca181ba | |||
| a0a8bbb57f | |||
| 1ffcb10bd2 | |||
| 10c8fcd3b8 | |||
| cafd900ad6 | |||
| e667ec9533 | |||
| 5ac4d93ae3 | |||
| 97b2e1b12a | |||
| 2304dd7bb1 | |||
| 44cedd5ea2 | |||
| 7ffbf6a3c8 | |||
| b5980a569c | |||
| 0550d13aee | |||
| 7912b1af7d | |||
| d95cdaae8e | |||
| 4a9cc8b491 | |||
| 6bd6b76d11 | |||
| 13a6ec753a | |||
| bda61cd5e5 | |||
| b42b05311b | |||
| 553c8fdec7 | |||
| 9a7e4a0112 | |||
| e141d8917a | |||
| 08840b9f8c | |||
| 0c858e2071 | |||
| 4625192940 | |||
| 2a75aa19bd | |||
| d95c3eeee1 | |||
| 22de642692 | |||
| 2a09e50d09 | |||
| 04109f8bee | |||
| 8ef7655e7b | |||
| 6bd525fd67 | |||
| 8c0684ad13 | |||
| 3c150953ed | |||
| d64869545d | |||
| 5888bee853 | |||
| ec5d501791 | |||
| 760edf9b87 | |||
| a05312f1b7 | |||
| abf6024faf | |||
| 380b87dc0c | |||
| f3087407c6 | |||
| 749738f2aa | |||
| 7d0eeab6f7 | |||
| dae72a7e1b | |||
| 96c6120609 | |||
| 6089f11c2f | |||
| 3536587665 | |||
| de594921cc | |||
| f40c48a83d | |||
| 7d17acfb2f | |||
| 4961a51cc7 | |||
| 94a0b8f573 | |||
| 0859c70936 | |||
| 6481b05e4f | |||
| 43e37f0184 | |||
| c739d1976b | |||
| 1d25a22201 | |||
| 73080c79d0 | |||
| 37725a0f2c | |||
| b3dd1e0386 | |||
| 108be781a4 | |||
| f6db5c1f30 | |||
| 2f2604d673 | |||
| 0894724496 | |||
| 9344f697f9 | |||
| 4c3ad9c95a | |||
| 38e42f92c2 | |||
| c38babecd9 | |||
| e01b285780 | |||
| 1b4fb6c758 | |||
| 95321a3516 | |||
| 0413d58860 | |||
| 86bd4d7389 | |||
| ff8e17ec2f | |||
| 37fe8c292a | |||
| cd703a5ee0 | |||
| 167f175f3a | |||
| a14abd0276 | |||
| 0fbf745efe | |||
| 92f5f0dfbb | |||
| 52d42d6e03 | |||
| 0cbb98b92c | |||
| 4c8642b70a | |||
| 9f2a672240 | |||
| 0ecb5fce78 | |||
| 65af47d90d | |||
| a57e638f57 | |||
| a4cee9ed37 | |||
| 6e5bf05211 | |||
| f7049de567 | |||
| 61b011869c | |||
| a33b9b2bb0 | |||
| 44113d58f5 | |||
| eb27bdd282 | |||
| daad23b3a7 | |||
| 1da0a4ae7d | |||
| 5833f52879 | |||
| 65ef662a2b | |||
| 8b8ee57a1a | |||
| a94cf0509f | |||
| cf6e32fc54 | |||
| 3a3e643eb9 | |||
| 462d6fa2b2 | |||
| 70138680cf | |||
| a16eaebb25 | |||
| d297280617 | |||
| eee306acda | |||
| c0a257fa0c | |||
| c6365ef868 | |||
| 54fa59f879 | |||
| 2baa9bd801 | |||
| a858ed7a2a | |||
| 921c668a59 | |||
| 0598a3ac43 | |||
| 0d724ca892 | |||
| b948e70258 | |||
| 5267eaac81 | |||
| 9b4634bebe | |||
| f8a54d2ae2 | |||
| 92744a195a | |||
| bc9bbc2431 | |||
| 16e101bba9 | |||
| 861fab8589 | |||
| 8ed7f965bb | |||
| 53d4006806 | |||
| 2761ec0b66 | |||
| d5c6520e4d | |||
| 5ea1cc7a8a | |||
| c50cb000dd | |||
| d4b9e9ab80 | |||
| 85b65befd5 | |||
| 77efd53f0c | |||
| 364da56ab4 | |||
| 9298482163 | |||
| 91f8919876 | |||
| 6323c9a73d | |||
| c08a73a6ca | |||
| 547e7a8308 | |||
| 6307b3bb64 | |||
| 32ab301c9d | |||
| 788d4672d7 | |||
| 1c35a7dad0 | |||
| 2d33674870 | |||
| e810379262 | |||
| d6036f9291 | |||
| ea6baf2220 | |||
| a0cb8cd446 | |||
| 8494fe20bc | |||
| 4a0077d685 | |||
| 9a194f24b8 | |||
| 4337957a6b | |||
| 2ecba5326b | |||
| 2a0532dacc | |||
| e63b09c9ad | |||
| f2c352366a | |||
| b52832ca7f | |||
| eb87bb4822 | |||
| 52924aaec0 | |||
| 85855b8cc7 | |||
| 3db4393b58 | |||
| 57630d2a64 | |||
| 6ac85d8d15 | |||
| 96df9799c3 | |||
| 07d637980c | |||
| 2b4e023180 | |||
| b5daea6d5f | |||
| 4088540aef | |||
| 44a8fed410 | |||
| 34cb4bdc9c | |||
| 09e5888ca8 | |||
| ce51655c81 | |||
| c819e0b063 | |||
| 37a4975544 | |||
| 6dab43c3a9 | |||
| 7579828180 | |||
| 751277a1ab | |||
| ad7993d7d5 | |||
| 7a5bd86ef4 | |||
| ac729e0ecf | |||
| 0ebc0d5844 | |||
| b133fee376 | |||
| 342265d290 | |||
| 5cdf2a8fdf | |||
| f08ee568b9 | |||
| bfa1dd3756 | |||
| f7cc2548f3 | |||
| a2960e22b9 | |||
| 21b84349d4 | |||
| d6e79f4366 | |||
| c00d951e06 | |||
| 6876df00ae | |||
| e888ea4ccb | |||
| 69f87ad916 | |||
| a710435535 | |||
| 72d4e9c29c | |||
| cac49bfc2e | |||
| fbfe19d6db | |||
| 6776cc6ee4 | |||
| ee14987721 | |||
| 5a398018ee | |||
| a73ad8cc8c | |||
| 46ce0cfa33 | |||
| a51e181e3b | |||
| db58acead1 | |||
| 2b046d79e1 | |||
| a56258945a | |||
| 0a87a4e75b | |||
| 7dcc7b372f | |||
| 9e13852135 | |||
| c9bdb1f0ae | |||
| 7fe5326c2d | |||
| b12af48a7d | |||
| 0db97c9681 | |||
| 88e4b69bfb | |||
| e6f26b46fc | |||
| 7006e4e3e6 | |||
| d244b81972 | |||
| 5b28259dac | |||
| efb5b0a28f | |||
| 22030f2fd3 | |||
| abeb0fbf5c | |||
| caba6b93ef | |||
| e2fa301bfb | |||
| 29eeb2828e | |||
| 75d422feca | |||
| 6f23efa970 | |||
| 4c1d5e01c6 | |||
| fdc4b0cf23 | |||
| f239fa56dd | |||
| 2c08f85744 | |||
| 1b27c13096 | |||
| f77fd4667e | |||
| 6af4ed6169 | |||
| 01f2ff1ba1 | |||
| 296223f876 | |||
| 0c4de6721d | |||
| 024cc50df4 | |||
| 6241995ad3 | |||
| d02cc020e8 | |||
| bc5c8e2c9c | |||
| 7237b1672e | |||
| 5e34a84d4a | |||
| 38448c104a | |||
| 8a5b67fb79 | |||
| aefcb3e8aa | |||
| fb36326a58 | |||
| 9b4326d91e | |||
| 6edb6dd1ca | |||
| 0ec7f4c25d | |||
| cec4f2ef57 | |||
| 52188a2127 | |||
| 83644fdb6a | |||
| 56d4063e92 | |||
| 1baa009266 | |||
| 1d2e15fbd7 | |||
| e3cbfcd44b | |||
| 4ac1070cd3 | |||
| bb2b687b46 | |||
| 38c1dd098c | |||
| 494cc6d3a5 | |||
| b174f067df | |||
| 7072b623af | |||
| 4a6d82acb9 | |||
| 9253c614d2 | |||
| 049ff9a3c7 | |||
| 73425c22d8 | |||
| 832ff3b9f9 | |||
| 635e36ff08 | |||
| 6618f9f184 | |||
| 7fcacb549b | |||
| 541e82144f | |||
| 18668870fd | |||
| 694f169832 | |||
| 7279273ebb | |||
| d89f2a4ac6 | |||
| 48375aa908 | |||
| 29957d4a47 | |||
| 4b152bd8ce | |||
| f782943099 | |||
| 3da0cf698f | |||
| e1c0f3eaef | |||
| 8bcf0ad7ab | |||
| 56b3b7a487 | |||
| bbd68b721d | |||
| 2d1e82c901 | |||
| 9a385dcb45 | |||
| 3dadd40034 | |||
| 566a774222 | |||
| 865dc9365c | |||
| 0500c9e53e | |||
| d3c5bdf4de | |||
| 7e41bf2259 | |||
| 6c1a634053 | |||
| f88e555234 | |||
| 87826f807a | |||
| b8fdc620aa | |||
| 466cf05912 | |||
| 8467143f2a | |||
| c346c09b01 | |||
| 3935b907d4 | |||
| 4e2641a915 | |||
| 973b0f883a | |||
| 6d97f09195 | |||
| 1c1ebd765d | |||
| 9eba3ef29a | |||
| e4696f7315 | |||
| 23b3807ea7 | |||
| 15b92e4097 | |||
| 922058dbc8 | |||
| b9e2c7896d | |||
| 9fbc1d71c0 | |||
| 3ae911b442 | |||
| eea376911b | |||
| 1db3037808 | |||
| 556e366ce5 | |||
| 6842518b1b | |||
| 8a775cd8d4 | |||
| 4d0f8c1da8 | |||
| 27e09007cc | |||
| 00128bd260 | |||
| f710bafae8 | |||
| 788d338c9b | |||
| 6f50f6e1ef | |||
| fd111df16d | |||
| 17958adaca | |||
| 0a05f6fa45 | |||
| 78103f3137 | |||
| f7da53cebd | |||
| 75f6dbb86c | |||
| 9d5f77db9d | |||
| b0cf6fbb7a | |||
| e3661abe84 | |||
| 1488d4f678 | |||
| adc50d465c | |||
| f6efd8aced | |||
| ad3c18eb5f | |||
| eabec630b9 | |||
| 406c83649b | |||
| 5f50b9f6e0 | |||
| 1b37c21da5 | |||
| 7144ec8db4 | |||
| f31bb101ad | |||
| 7c754d0665 | |||
| 5f7eda1f98 | |||
| f8f6d56c58 | |||
| 8ad458e955 | |||
| 8ea06b75aa | |||
| c3ae4790c7 | |||
| 5cd86f740d | |||
| aa06c9fbc1 | |||
| 100ca0b8a2 | |||
| 8669481309 | |||
| 1dc4a319ab | |||
| 08ba72afa2 | |||
| 0a905d674b | |||
| 319afebdc0 | |||
| f1e92dd184 | |||
| 9048e565d7 | |||
| 95dec684ad | |||
| 0d40f705a7 | |||
| df8a0fe8dc | |||
| 50a9b4d1e7 | |||
| 2e30b9f382 | |||
| 23869e5b2a | |||
| 3ba2a1354f | |||
| 903df56837 | |||
| 4a53ee5a13 | |||
| cfd6e7eab9 | |||
| a98814b930 | |||
| 10c763da6f | |||
| a020a55f9d | |||
| 6552adafb2 | |||
| 5756e31999 | |||
| 8ae9f0914b | |||
| 3c4a18f0df | |||
| 165e6f1948 | |||
| 750a17653d | |||
| 07b48484ff | |||
| a664fb1e45 | |||
| 2e6ef74593 | |||
| 440b65bf77 | |||
| df7996b671 | |||
| 9a698e6b7b | |||
| 915109b2c4 | |||
| 2fa86736dd | |||
| b9125001f0 | |||
| f17624194b | |||
| 7360a2532d | |||
| 72eb905c58 | |||
| ad90dbdaff | |||
| e0a2b195e4 | |||
| 1c676ac0ec | |||
| 538b6d21b1 | |||
| 3157aff844 | |||
| f4898a2e3a | |||
| 555be63c90 | |||
| 057efbfe95 | |||
| 585db1f667 | |||
| 7f6a1666fa | |||
| 0c621246d3 | |||
| 5bd798c6e1 | |||
| 5ecd2b850c | |||
| 243adff49c | |||
| 378531b709 | |||
| 9584c23594 | |||
| 64f20ec624 | |||
| 783e928ae8 | |||
| a673994de5 | |||
| 9b0e27c98c | |||
| a3712a3288 | |||
| 74e03de760 | |||
| 09e302384a | |||
| 3dc374ddcf | |||
| 90a72f9acd | |||
| 7c1625b0e0 | |||
| cd443f0d5b | |||
| d5194725b7 | |||
| 82e3ec3afe | |||
| 682def9f89 | |||
| 96aece07f3 | |||
| 508a879ef0 | |||
| 5171e46c47 | |||
| 1ee939e7c4 | |||
| 59f33c1cc1 | |||
| fb95a8b34b | |||
| d104ced953 | |||
| 1fd54698ff | |||
| 2658e01baa | |||
| 9612b891c9 | |||
| 27fc833550 | |||
| 0b3e0d74b0 | |||
| d75b4cf613 | |||
| 5aab6ff81b | |||
| f076ff5dbd | |||
| b8ab763581 | |||
| 78a9821129 | |||
| 5dbbda5435 | |||
| b1e0aa487d | |||
| 6505e28c40 | |||
| 7adf0d88a0 | |||
| fc004c0ad2 | |||
| f07c39be8a | |||
| 29ffe6f426 | |||
| ec63c604ab | |||
| 69ca2ad676 | |||
| 3d587f3043 | |||
| ae1e384a9a | |||
| 954f6110d6 | |||
| 4390b8df12 | |||
| cb88e15b33 | |||
| 1705067e65 | |||
| 618a735816 | |||
| 136de91049 | |||
| 103ff8e23d | |||
| e2bf45f262 | |||
| cdb929aada | |||
| 93d990c653 | |||
| 62af16b9f2 | |||
| 3dfd02b4b4 | |||
| 7a7bd8f6d7 | |||
| 16312fcfb9 | |||
| a81a88cca0 | |||
| 5acedf5027 | |||
| 566c601d41 | |||
| ba1d773176 | |||
| 583146f9d6 | |||
| c789941d76 | |||
| 232c355b3a | |||
| 773c7265e8 | |||
| 742c436d28 | |||
| 15214a53ce | |||
| 36b855972b | |||
| d5f4862405 | |||
| 735c03fcf3 | |||
| 4a1985f870 | |||
| 4519c237c5 | |||
| ac8279a0a5 | |||
| 7cab19a2e4 | |||
| 4ee9fd77fd | |||
| 556cdf5f1a | |||
| c760fe9a2e | |||
| 24a0bc23cf | |||
| c3178ff942 | |||
| f8cc8b844a | |||
| e341bdc1b7 | |||
| 09734e8028 | |||
| 7d20d0e2d2 | |||
| 0059b17dfc | |||
| e733b24dfe | |||
| f7c8252611 | |||
| e66e3ca523 | |||
| 24660c3e48 | |||
| ee6348a7a0 | |||
| a44303c373 | |||
| f49e9ee41b | |||
| 1ba03b164a | |||
| 9c1e703990 | |||
| f2112be4d8 | |||
| c82895fb65 | |||
| b840341a77 | |||
| ed7623273a | |||
| 9425a7e0ab | |||
| 93438eca0b | |||
| e28615628b | |||
| fa64a1ced0 | |||
| 0f553e7f9e | |||
| f4e57fd529 | |||
| a0e2bca79a | |||
| 63a0343dda | |||
| 5db7413827 | |||
| d163aeb80d | |||
| 60205944bb | |||
| 03832c130c | |||
| 9f93e25b88 | |||
| afaebc3869 | |||
| fdf57a9788 | |||
| 5609cd4c74 | |||
| a0323d446c | |||
| 0db76e98f9 | |||
| fa33fbce75 | |||
| bcc7192af7 | |||
| 0d27b7a7ff | |||
| 6d202894b6 | |||
| ff300b10e1 | |||
| 18c7efe800 | |||
| 0931062a3f | |||
| 3b4c951838 | |||
| c2c08af16d | |||
| 9e49be41b6 | |||
| dd86c97e18 | |||
| 5a8e6bda51 | |||
| c34211417c | |||
| 974c534210 | |||
| 5a58fd2de0 | |||
| faec973e09 | |||
| 65b7e515a2 | |||
| 318c4b44ea | |||
| b6e5187973 | |||
| 1e8cb4b4a4 | |||
| 9daa0d4d2f | |||
| ceb7324657 | |||
| da00d28cb7 | |||
| c23d5e0143 | |||
| d8658dbc47 | |||
| a6a4c042f5 | |||
| 6be0b410dc | |||
| 051d340171 | |||
| 0a4233f0f6 | |||
| ecc66719bd | |||
| 03d51c5677 | |||
| 268c6ab36c | |||
| 0786f31f22 | |||
| 883116e4af | |||
| 5748034cd3 | |||
| 061e7f0da7 | |||
| a138dc3970 | |||
| fa2b204535 | |||
| 73c7af102b | |||
| 18a8ae5a8a | |||
| fa65bf89be | |||
| 60c8b0e02f | |||
| acac4a7fca | |||
| 6be5ffe54f | |||
| ba843f0ad9 | |||
| 4297be6ac1 | |||
| 7d02933da3 | |||
| d2003a6fff | |||
| ef0483b4be | |||
| 9e51b2e5df | |||
| 951e946e71 | |||
| 1fccf6fa53 | |||
| 7f8fc584de | |||
| 1d1d2ba661 | |||
| 520bf7ac61 | |||
| 85f50d3e06 | |||
| e12cb97e16 | |||
| a3a7e6fa34 | |||
| 3881175d72 | |||
| ef32c04795 | |||
| 42da4d6867 | |||
| f7bb84ce4c | |||
| 5bd1c0d063 | |||
| c67d81bae1 | |||
| a5d1ac7ed0 | |||
| b8187aa529 | |||
| 877f440331 | |||
| 58892471a3 | |||
| 90ed1af972 | |||
| 21344b91ed | |||
| 3f9673c177 | |||
| fce2513827 | |||
| 3debb8820e | |||
| d3a4e31fe2 | |||
| 25ac33486c | |||
| 5803e11663 | |||
| b33372cc92 | |||
| bcb2b5d1cd | |||
| 3f2a2b5f62 | |||
| 4972bf4f23 | |||
| 3d2e5c0310 | |||
| f547b6ff27 | |||
| 5272799bdd | |||
| 1a230e3aa5 | |||
| 679b7d147c | |||
| 8effd1e02a | |||
| cb19930b83 | |||
| c6b07b33c5 | |||
| 47e37975c9 | |||
| 5472eedbad | |||
| af95fe7a93 | |||
| 705b0b0001 | |||
| 35c931126b | |||
| 6aada9d356 | |||
| da9161fc91 | |||
| 1e78adc28c | |||
| fcdf8f4618 | |||
| 8533499507 | |||
| fb4659c5d7 | |||
| a1408a3411 | |||
| f06738828b | |||
| b6b1c0130b | |||
| ea305cf32e | |||
| d41102d6c3 | |||
| 0c27ecc536 | |||
| 0f55c18595 | |||
| e5fbbda9ba | |||
| 7650210ad6 | |||
| ba125961d6 | |||
| 2bb06b1af4 | |||
| 8108f2f9b9 | |||
| 08dfaab829 | |||
| d1c121b599 | |||
| e98b187e64 | |||
| 87326f7313 | |||
| 7f3eee750a | |||
| ace35fdeda | |||
| bf4c9d700d | |||
| c7d99531a7 | |||
| ca7ee098ca | |||
| ec8efd52b4 | |||
| 9a83ced46e | |||
| 0d7bf01ac1 | |||
| 1229c28ce0 | |||
| f7ca35c9c6 | |||
| c08d1439dd | |||
| 09d437c1f9 | |||
| 492d4ac013 | |||
| 870ea2a88a | |||
| 29f4a38c0d | |||
| 1ada3b633e | |||
| 0ce14a078a | |||
| 45b81c969f | |||
| cfb7f80003 | |||
| 628dea7a08 | |||
| 22de765f3c | |||
| ae4e9845de | |||
| 95dc7525ac | |||
| f1cce7e223 | |||
| f2fb8cf23b | |||
| 9f900f6dba | |||
| 91f16a7e47 | |||
| 6bc2ae3731 | |||
| 885b76f66f | |||
| ded2b0a55c | |||
| 0f08b1d099 | |||
| aaa5ef81cf | |||
| cb791a1b21 | |||
| 0b489f4d79 | |||
| c187517395 | |||
| 89e2b7424b | |||
| 1f06fd7e66 | |||
| e5da0986bb | |||
| 0fc9578fe6 | |||
| b1ea59e814 | |||
| 7d48d79b53 | |||
| 6d5a73815d | |||
| d1f336d8fd | |||
| 48072e439d | |||
| 9700e6b4bd | |||
| 722879b32d | |||
| 943a663a31 | |||
| 2acb1abb1f | |||
| 4eb8d2bb10 | |||
| 04fc35707d | |||
| 09014f90f9 | |||
| 0c667ca32a | |||
| 7c4a2a0a29 | |||
| c801c8d2bb | |||
| 98e862e162 | |||
| b9d72d2991 | |||
| c6612871fb | |||
| b991fca341 | |||
| ef3bbbcf40 | |||
| 32f0fe5d08 | |||
| 6d987f1418 | |||
| de99bccbfd | |||
| 0cc882ef9d | |||
| 3f4420527b | |||
| 21d06999f6 | |||
| f3803d3a5d | |||
| c6da044dc5 | |||
| 02a6b05bde | |||
| 242400e9ea | |||
| 8c1daaab57 | |||
| 7f62c8e145 | |||
| e2876b947d | |||
| ed3a513f86 | |||
| b72088a90a | |||
| 8b58fc7191 | |||
| d9fa59f30a | |||
| 13e2132b69 | |||
| 298e1b5fdc | |||
| 5294f3b9b7 | |||
| b191e67552 | |||
| fac773ac99 | |||
| 82769e54c3 | |||
| 022f2bc177 | |||
| ccf79ee483 | |||
| ecf0725dd1 | |||
| d3ef93a9a5 | |||
| 47a7a575e8 | |||
| ff8fe4be7e | |||
| d7a6e7be2e | |||
| a81e948fc9 | |||
| ccfd370b89 | |||
| 91516b2318 | |||
| 52f7b6e03b | |||
| 64ab594ad6 | |||
| 394987f365 | |||
| df4b317fb3 | |||
| 142f6c3f05 | |||
| 414adb94f0 | |||
| 7ee98cf525 | |||
| d418da6b91 | |||
| 2a0f2a8ba8 | |||
| 5513dfd3cf | |||
| c18ffd7c81 | |||
| 424ab2a024 | |||
| e2b97d6712 | |||
| 217a616fde | |||
| 56de324afe | |||
| fa36244bec | |||
| 4fe31f8d4d | |||
| cfa9ad9943 | |||
| fd981ad315 | |||
| 5f9a86a8f2 | |||
| 956d6632d9 | |||
| 0c7b2ec09e | |||
| 4cbcaf35e4 | |||
| 73baf0b635 | |||
| 78dc37739f | |||
| ac0a4327a9 | |||
| c20e620a06 | |||
| 4bc45e35c2 | |||
| b362e886ec | |||
| ca38899ede | |||
| 61973af29f |
5
.changeset/beige-buses-drop.md
Normal file
5
.changeset/beige-buses-drop.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Initializable`: optimize `_disableInitializers` by using `!=` instead of `<`. ([#3787](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3787))
|
||||
12
.changeset/config.json
Normal file
12
.changeset/config.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
|
||||
"changelog": [
|
||||
"@changesets/changelog-github",
|
||||
{
|
||||
"repo": "OpenZeppelin/openzeppelin-contracts"
|
||||
}
|
||||
],
|
||||
"commit": false,
|
||||
"access": "public",
|
||||
"baseBranch": "master"
|
||||
}
|
||||
5
.changeset/curvy-shrimps-enjoy.md
Normal file
5
.changeset/curvy-shrimps-enjoy.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714))
|
||||
5
.changeset/curvy-suns-sort.md
Normal file
5
.changeset/curvy-suns-sort.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Ownable2Step`: make `acceptOwnership` public virtual to enable usecases that require overriding it. ([#3960](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3960))
|
||||
5
.changeset/early-oranges-raise.md
Normal file
5
.changeset/early-oranges-raise.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ERC721Wrapper`: add a new extension of the `ERC721` token which wraps an underlying token. Deposit and withdraw guarantee that the ownership of each token is backed by a corresponding underlying token with the same identifier.
|
||||
5
.changeset/famous-rules-burn.md
Normal file
5
.changeset/famous-rules-burn.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`EnumerableMap`: add a `keys()` function that returns an array containing all the keys. ([#3920](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3920))
|
||||
5
.changeset/five-ducks-develop.md
Normal file
5
.changeset/five-ducks-develop.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`UUPSUpgradeable.sol`: Change visibility to the functions `upgradeTo ` and `upgradeToAndCall ` from `external` to `public`.
|
||||
5
.changeset/five-poets-mix.md
Normal file
5
.changeset/five-poets-mix.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`TimelockController`: Add the `CallSalt` event to emit on operation schedule.
|
||||
5
.changeset/flat-deers-end.md
Normal file
5
.changeset/flat-deers-end.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Governor`: add a public `cancel(uint256)` function.
|
||||
5
.changeset/four-bats-sniff.md
Normal file
5
.changeset/four-bats-sniff.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Governor`: Enable timestamp operation for blockchains without a stable block time. This is achieved by connecting a Governor's internal clock to match a voting token's EIP-6372 interface.
|
||||
5
.changeset/funny-rockets-compete.md
Normal file
5
.changeset/funny-rockets-compete.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
Reformatted codebase with latest version of Prettier Solidity. ([#3898](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3898))
|
||||
5
.changeset/gold-chicken-clean.md
Normal file
5
.changeset/gold-chicken-clean.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Strings`: add `equal` method. ([#3774](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3774))
|
||||
5
.changeset/happy-socks-travel.md
Normal file
5
.changeset/happy-socks-travel.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`IERC5313`: Add an interface for EIP-5313 that is now final.
|
||||
5
.changeset/healthy-squids-stare.md
Normal file
5
.changeset/healthy-squids-stare.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Math`: optimize `log256` rounding check. ([#3745](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3745))
|
||||
5
.changeset/lemon-dogs-kiss.md
Normal file
5
.changeset/lemon-dogs-kiss.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ERC20Votes`: optimize by using unchecked arithmetic. ([#3748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3748))
|
||||
5
.changeset/little-kiwis-ring.md
Normal file
5
.changeset/little-kiwis-ring.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Multicall`: annotate `multicall` function as upgrade safe to not raise a flag for its delegatecall. ([#3961](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3961))
|
||||
5
.changeset/lovely-dragons-appear.md
Normal file
5
.changeset/lovely-dragons-appear.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`IERC4906`: Add an interface for ERC-4906 that is now Final.
|
||||
5
.changeset/many-panthers-hide.md
Normal file
5
.changeset/many-panthers-hide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`TransparentUpgradeableProxy`: support value passthrough for all ifAdmin function.
|
||||
5
.changeset/modern-games-exist.md
Normal file
5
.changeset/modern-games-exist.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`StorageSlot`: Add support for `string` and `bytes`.
|
||||
5
.changeset/new-ways-own.md
Normal file
5
.changeset/new-ways-own.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ERC20Pausable`, `ERC721Pausable`, `ERC1155Pausable`: Add note regarding missing public pausing functionality
|
||||
5
.changeset/ninety-hornets-kick.md
Normal file
5
.changeset/ninety-hornets-kick.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Votes`, `ERC20Votes`, `ERC721Votes`: support timestamp checkpointing using EIP-6372.
|
||||
5
.changeset/perfect-insects-listen.md
Normal file
5
.changeset/perfect-insects-listen.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ERC4626`: Add mitigation to the inflation attack through virtual shares and assets.
|
||||
5
.changeset/pretty-hornets-play.md
Normal file
5
.changeset/pretty-hornets-play.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Strings`: add `toString` method for signed integers. ([#3773](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3773))
|
||||
5
.changeset/proud-comics-deliver.md
Normal file
5
.changeset/proud-comics-deliver.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ERC20Wrapper`: Make the `underlying` variable private and add a public accessor.
|
||||
5
.changeset/short-roses-judge.md
Normal file
5
.changeset/short-roses-judge.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`EIP712`: add EIP-5267 support for better domain discovery.
|
||||
5
.changeset/silent-dancers-type.md
Normal file
5
.changeset/silent-dancers-type.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`AccessControlDefaultAdminRules`: Add an extension of `AccessControl` with additional security rules for the `DEFAULT_ADMIN_ROLE`.
|
||||
5
.changeset/slimy-knives-hug.md
Normal file
5
.changeset/slimy-knives-hug.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`SignatureChecker`: Add `isValidERC1271SignatureNow` for checking a signature directly against a smart contract using ERC-1271.
|
||||
5
.changeset/small-cars-appear.md
Normal file
5
.changeset/small-cars-appear.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ECDSA`: Add a function `toDataWithIntendedValidatorHash` that encodes data with version 0x00 following EIP-191.
|
||||
5
.changeset/small-terms-sleep.md
Normal file
5
.changeset/small-terms-sleep.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`SafeERC20`: Add a `forceApprove` function to improve compatibility with tokens behaving like USDT.
|
||||
5
.changeset/strong-bulldogs-buy.md
Normal file
5
.changeset/strong-bulldogs-buy.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ERC1967Upgrade`: removed contract-wide `oz-upgrades-unsafe-allow delegatecall` annotation, replaced by granular annotation in `UUPSUpgradeable`.
|
||||
5
.changeset/tame-ladybugs-sit.md
Normal file
5
.changeset/tame-ladybugs-sit.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`MerkleProof`: optimize by using unchecked arithmetic. ([#3745](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3745))
|
||||
5
.changeset/thin-dragons-report.md
Normal file
5
.changeset/thin-dragons-report.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ECDSA`: optimize bytes32 computation by using assembly instead of `abi.encodePacked`.
|
||||
5
.changeset/thirty-swans-exercise.md
Normal file
5
.changeset/thirty-swans-exercise.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ERC721URIStorage`: Emit ERC-4906 `MetadataUpdate` in `_setTokenURI`.
|
||||
5
.changeset/violet-frogs-hide.md
Normal file
5
.changeset/violet-frogs-hide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ShortStrings`: Added a library for handling short strings in a gas efficient way, with fallback to storage for longer strings.
|
||||
5
.changeset/warm-masks-obey.md
Normal file
5
.changeset/warm-masks-obey.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`SignatureChecker`: Allow return data length greater than 32 from EIP-1271 signers.
|
||||
5
.changeset/yellow-swans-cover.md
Normal file
5
.changeset/yellow-swans-cover.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`UUPSUpgradeable`: added granular `oz-upgrades-unsafe-allow-reachable` annotation to improve upgrade safety checks on latest version of the Upgrades Plugins (starting with `@openzeppelin/upgrades-core@1.21.0`).
|
||||
@ -1,84 +0,0 @@
|
||||
version: 2
|
||||
# 2.1 does not yet support local run
|
||||
# unless with workaround. For simplicity just use it.
|
||||
# https://github.com/CircleCI-Public/circleci-cli/issues/79
|
||||
|
||||
aliases:
|
||||
- &defaults
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
|
||||
- &cache_key_node_modules
|
||||
key: v1-node_modules-{{ checksum "package-lock.json" }}
|
||||
|
||||
jobs:
|
||||
dependencies:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
<<: *cache_key_node_modules
|
||||
- run:
|
||||
name: Install npm dependencies and prepare
|
||||
command: |
|
||||
if [ ! -d node_modules ]; then
|
||||
npm ci
|
||||
else
|
||||
npm run prepare
|
||||
fi
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- node_modules
|
||||
- build
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
<<: *cache_key_node_modules
|
||||
|
||||
lint:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Linter
|
||||
command: npm run lint
|
||||
test:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Unit tests
|
||||
command: npm run test
|
||||
|
||||
coverage:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Unit tests with coverage report
|
||||
command: npm run coverage
|
||||
|
||||
# TODO(xinbenlv, #1839): run SOLC_NIGHTLY to be run but allow it to fail.
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
everything:
|
||||
jobs:
|
||||
- dependencies
|
||||
- lint:
|
||||
requires:
|
||||
- dependencies
|
||||
- test:
|
||||
requires:
|
||||
- dependencies
|
||||
- coverage:
|
||||
requires:
|
||||
- dependencies
|
||||
|
||||
11
.codecov.yml
11
.codecov.yml
@ -1,3 +1,12 @@
|
||||
comment: off
|
||||
github_checks:
|
||||
annotations: false
|
||||
coverage:
|
||||
range: "100...100"
|
||||
status:
|
||||
patch:
|
||||
default:
|
||||
target: 95%
|
||||
only_pulls: true
|
||||
project:
|
||||
default:
|
||||
threshold: 1%
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
version: 1
|
||||
|
||||
update_configs:
|
||||
- package_manager: "javascript"
|
||||
directory: "/"
|
||||
update_schedule: "weekly"
|
||||
version_requirement_updates: "increase_versions"
|
||||
@ -8,7 +8,7 @@ charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
trim_trailing_whitespace = false
|
||||
max_line_length = 120
|
||||
|
||||
[*.sol]
|
||||
@ -16,3 +16,6 @@ indent_size = 4
|
||||
|
||||
[*.js]
|
||||
indent_size = 2
|
||||
|
||||
[*.{adoc,md}]
|
||||
max_line_length = 0
|
||||
|
||||
66
.eslintrc
66
.eslintrc
@ -1,62 +1,20 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends" : [
|
||||
"standard",
|
||||
"plugin:promise/recommended",
|
||||
],
|
||||
"plugins": [
|
||||
"mocha-no-only",
|
||||
"promise",
|
||||
"eslint:recommended",
|
||||
"prettier",
|
||||
],
|
||||
"env": {
|
||||
"browser" : true,
|
||||
"node" : true,
|
||||
"mocha" : true,
|
||||
"jest" : true,
|
||||
"es2022": true,
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"mocha": true,
|
||||
},
|
||||
"globals" : {
|
||||
"artifacts": false,
|
||||
"contract": false,
|
||||
"assert": false,
|
||||
"web3": false,
|
||||
},
|
||||
"rules": {
|
||||
|
||||
// Strict mode
|
||||
"strict": ["error", "global"],
|
||||
|
||||
// Code style
|
||||
"array-bracket-spacing": ["off"],
|
||||
"camelcase": ["error", {"properties": "always"}],
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"comma-spacing": ["error", {"before": false, "after": true}],
|
||||
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}],
|
||||
"eol-last": ["error", "always"],
|
||||
"eqeqeq": ["error", "smart"],
|
||||
"generator-star-spacing": ["error", "before"],
|
||||
"indent": ["error", 2],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"max-len": ["error", 120, 2],
|
||||
"no-debugger": "off",
|
||||
"no-dupe-args": "error",
|
||||
"no-dupe-keys": "error",
|
||||
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
||||
"no-redeclare": ["error", {"builtinGlobals": true}],
|
||||
"no-trailing-spaces": ["error", { "skipBlankLines": false }],
|
||||
"no-undef": "error",
|
||||
"no-use-before-define": "off",
|
||||
"no-var": "error",
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"prefer-const": "error",
|
||||
"quotes": ["error", "single"],
|
||||
"semi": ["error", "always"],
|
||||
"space-before-function-paren": ["error", "always"],
|
||||
|
||||
"mocha-no-only/mocha-no-only": ["error"],
|
||||
|
||||
"promise/always-return": "off",
|
||||
"promise/avoid-new": "off",
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
"artifacts": "readonly",
|
||||
"contract": "readonly",
|
||||
"web3": "readonly",
|
||||
"extendEnvironment": "readonly",
|
||||
"expect": "readonly",
|
||||
}
|
||||
}
|
||||
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1 +0,0 @@
|
||||
*.sol linguist-language=Solidity
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,4 +1,4 @@
|
||||
contact_links:
|
||||
- name: Support request
|
||||
- name: Questions & Support Requests
|
||||
url: https://forum.openzeppelin.com/c/support/contracts/18
|
||||
about: Ask the community in the Community Forum
|
||||
about: Ask in the OpenZeppelin Forum
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -10,5 +10,5 @@ about: Suggest an idea for OpenZeppelin Contracts
|
||||
**📝 Details**
|
||||
<!-- Please describe your feature request in detail. -->
|
||||
|
||||
<!-- Make sure that you have reviewed the OpenZeppelin Contributor Guidelines. -->
|
||||
<!-- Make sure that you have reviewed the OpenZeppelin Contracts Contributor Guidelines. -->
|
||||
<!-- https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md -->
|
||||
|
||||
32
.github/PULL_REQUEST_TEMPLATE.md
vendored
32
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,22 +1,20 @@
|
||||
<!-- 0. 🎉 Thank you for submitting a PR! -->
|
||||
<!-- Thank you for your interest in contributing to OpenZeppelin! -->
|
||||
|
||||
<!-- 1. Does this close any open issues? Please list them below. -->
|
||||
<!-- Consider opening an issue for discussion prior to submitting a PR. -->
|
||||
<!-- New features will be merged faster if they were first discussed and designed with the team. -->
|
||||
|
||||
<!-- Keep in mind that new features have a better chance of being merged fast if
|
||||
they were first discussed and designed with the maintainers. If there is no
|
||||
corresponding issue, please consider opening one for discussion first! -->
|
||||
Fixes #???? <!-- Fill in with issue number -->
|
||||
|
||||
Fixes #
|
||||
<!-- Describe the changes introduced in this pull request. -->
|
||||
<!-- Include any context necessary for understanding the PR's purpose. -->
|
||||
|
||||
<!-- 2. Describe the changes introduced in this pull request. -->
|
||||
<!-- Include any context necessary for understanding the PR's purpose. -->
|
||||
|
||||
<!-- 3. Before submitting, please make sure that you have:
|
||||
- reviewed the OpenZeppelin Contributor Guidelines
|
||||
(https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md),
|
||||
- added tests where applicable to test new functionality,
|
||||
- made sure that your contracts are well-documented,
|
||||
- run the Solidity linter (`npm run lint:sol`) and fixed any issues,
|
||||
- run the JS linter and fixed any issues (`npm run lint:fix`), and
|
||||
- updated the changelog, if applicable.
|
||||
-->
|
||||
#### PR Checklist
|
||||
|
||||
<!-- Before merging the pull request all of the following must be complete. -->
|
||||
<!-- Feel free to submit a PR or Draft PR even if some items are pending. -->
|
||||
<!-- Some of the items may not apply. -->
|
||||
|
||||
- [ ] Tests
|
||||
- [ ] Documentation
|
||||
- [ ] Changeset entry (run `npx changeset add`)
|
||||
|
||||
49
.github/actions/gas-compare/action.yml
vendored
Normal file
49
.github/actions/gas-compare/action.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: Compare gas costs
|
||||
inputs:
|
||||
token:
|
||||
description: github token
|
||||
required: true
|
||||
report:
|
||||
description: report to read from
|
||||
required: false
|
||||
default: gasReporterOutput.json
|
||||
out_report:
|
||||
description: report to read
|
||||
required: false
|
||||
default: ${{ github.ref_name }}.gasreport.json
|
||||
ref_report:
|
||||
description: report to read from
|
||||
required: false
|
||||
default: ${{ github.base_ref }}.gasreport.json
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download reference report
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
|
||||
gh run download ${RUN_ID} --repo ${{ github.repository }} -n gasreport
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ inputs.token }}
|
||||
shell: bash
|
||||
continue-on-error: true
|
||||
id: reference
|
||||
- name: Compare reports
|
||||
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
|
||||
run: |
|
||||
node scripts/checks/compareGasReports.js ${{ inputs.report }} ${{ inputs.ref_report }} >> $GITHUB_STEP_SUMMARY
|
||||
env:
|
||||
STYLE: markdown
|
||||
shell: bash
|
||||
- name: Rename report for upload
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
mv ${{ inputs.report }} ${{ inputs.out_report }}
|
||||
shell: bash
|
||||
- name: Save report
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: gasreport
|
||||
path: ${{ inputs.out_report }}
|
||||
19
.github/actions/setup/action.yml
vendored
Normal file
19
.github/actions/setup/action.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: Setup
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: npm-v3-${{ hashFiles('**/package-lock.json') }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
shell: bash
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
env:
|
||||
SKIP_COMPILE: true
|
||||
55
.github/actions/storage-layout/action.yml
vendored
Normal file
55
.github/actions/storage-layout/action.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
name: Compare storage layouts
|
||||
inputs:
|
||||
token:
|
||||
description: github token
|
||||
required: true
|
||||
buildinfo:
|
||||
description: compilation artifacts
|
||||
required: false
|
||||
default: artifacts/build-info/*.json
|
||||
layout:
|
||||
description: extracted storage layout
|
||||
required: false
|
||||
default: HEAD.layout.json
|
||||
out_layout:
|
||||
description: storage layout to upload
|
||||
required: false
|
||||
default: ${{ github.ref_name }}.layout.json
|
||||
ref_layout:
|
||||
description: storage layout for the reference branch
|
||||
required: false
|
||||
default: ${{ github.base_ref }}.layout.json
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Extract layout
|
||||
run: |
|
||||
node scripts/checks/extract-layout.js ${{ inputs.buildinfo }} > ${{ inputs.layout }}
|
||||
shell: bash
|
||||
- name: Download reference
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
|
||||
gh run download ${RUN_ID} --repo ${{ github.repository }} -n layout
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ inputs.token }}
|
||||
shell: bash
|
||||
continue-on-error: true
|
||||
id: reference
|
||||
- name: Compare layouts
|
||||
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
|
||||
run: |
|
||||
node scripts/checks/compare-layout.js --head ${{ inputs.layout }} --ref ${{ inputs.ref_layout }}
|
||||
shell: bash
|
||||
- name: Rename artifacts for upload
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
mv ${{ inputs.layout }} ${{ inputs.out_layout }}
|
||||
shell: bash
|
||||
- name: Save artifacts
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: layout
|
||||
path: ${{ inputs.out_layout }}
|
||||
67
.github/stale.yml
vendored
67
.github/stale.yml
vendored
@ -1,67 +0,0 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 15
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 15
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- on hold
|
||||
- meta
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Set to true to ignore issues with an assignee (defaults to false)
|
||||
exemptAssignees: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
Hi all!
|
||||
|
||||
This Pull Request has not had any recent activity, is it still relevant? If so, what is blocking it?
|
||||
Is there anything we can do to help move it forward?
|
||||
|
||||
Thanks!
|
||||
|
||||
|
||||
# Comment to post when removing the stale label.
|
||||
# unmarkComment: >
|
||||
# Your comment here.
|
||||
|
||||
# Comment to post when closing a stale Issue or Pull Request.
|
||||
closeComment: >
|
||||
Hi folks!
|
||||
|
||||
This Pull Request is being closed as there was no response to the previous prompt.
|
||||
However, please leave a comment whenever you're ready to resume, so it can be reopened.
|
||||
|
||||
Thanks again!
|
||||
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
# Limit to only `issues` or `pulls`
|
||||
only: pulls
|
||||
|
||||
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
|
||||
# pulls:
|
||||
# daysUntilStale: 30
|
||||
# markComment: >
|
||||
# This pull request has been automatically marked as stale because it has not had
|
||||
# recent activity. It will be closed if no further activity occurs. Thank you
|
||||
# for your contributions.
|
||||
|
||||
# issues:
|
||||
# exemptLabels:
|
||||
# - confirmed
|
||||
18
.github/workflows/actionlint.yml
vendored
Normal file
18
.github/workflows/actionlint.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: lint workflows
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/**/*.ya?ml'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Add problem matchers
|
||||
run: |
|
||||
# https://github.com/rhysd/actionlint/blob/3a2f2c7/docs/usage.md#problem-matchers
|
||||
curl -LO https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
|
||||
echo "::add-matcher::actionlint-matcher.json"
|
||||
- uses: docker://rhysd/actionlint:latest
|
||||
28
.github/workflows/changeset.yml
vendored
Normal file
28
.github/workflows/changeset.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
name: changeset
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
concurrency:
|
||||
group: changeset-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Include history so Changesets finds merge-base
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- name: Check changeset
|
||||
run: npx changeset status --since=origin/${{ github.base_ref }}
|
||||
96
.github/workflows/checks.yml
vendored
Normal file
96
.github/workflows/checks.yml
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
name: checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-v*
|
||||
pull_request: {}
|
||||
workflow_dispatch: {}
|
||||
|
||||
concurrency:
|
||||
group: checks-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: npm run lint
|
||||
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
GAS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- name: Run tests and generate gas report
|
||||
run: npm run test
|
||||
- name: Check linearisation of the inheritance graph
|
||||
run: npm run test:inheritance
|
||||
- name: Check proceduraly generated contracts are up-to-date
|
||||
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
|
||||
run: npm run test:generation
|
||||
- name: Compare gas costs
|
||||
uses: ./.github/actions/gas-compare
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
- name: Check storage layout
|
||||
uses: ./.github/actions/storage-layout
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
|
||||
foundry-tests:
|
||||
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Foundry
|
||||
uses: foundry-rs/foundry-toolchain@v1
|
||||
with:
|
||||
version: nightly
|
||||
- name: Run tests
|
||||
run: forge test -vv
|
||||
|
||||
coverage:
|
||||
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: npm run coverage
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
- uses: codecov/codecov-action@v3
|
||||
|
||||
slither:
|
||||
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: rm foundry.toml
|
||||
- uses: crytic/slither-action@v0.3.0
|
||||
|
||||
codespell:
|
||||
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run CodeSpell
|
||||
uses: codespell-project/actions-codespell@v1.0
|
||||
with:
|
||||
check_filenames: true
|
||||
skip: package-lock.json,*.pdf
|
||||
19
.github/workflows/docs.yml
vendored
Normal file
19
.github/workflows/docs.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: Build Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [release-v*]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
- run: node scripts/update-docs-branch.js
|
||||
- run: git push --all origin
|
||||
55
.github/workflows/formal-verifiation.yml
vendored
Normal file
55
.github/workflows/formal-verifiation.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
name: Formal verification
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-v*
|
||||
- formal-verification
|
||||
pull_request: {}
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
list-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: set-matrix
|
||||
run: echo ::set-output name=matrix::$(ls certora/scripts/{,**}/*.sh | grep -v '\WnoCI\W' | jq -Rsc 'split("\n")[:-1]')
|
||||
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
needs: list-scripts
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
- name: Install java
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '11'
|
||||
java-package: 'jre'
|
||||
- name: Install certora
|
||||
run: pip install certora-cli
|
||||
- name: Install solc
|
||||
run: |
|
||||
wget https://github.com/ethereum/solidity/releases/download/v0.8.19/solc-static-linux
|
||||
sudo mv solc-static-linux /usr/local/bin/solc
|
||||
chmod +x /usr/local/bin/solc
|
||||
- name: Verify rule ${{ matrix.params }}
|
||||
run: |
|
||||
touch certora/applyHarness.patch
|
||||
make -C certora munged
|
||||
bash ${{ matrix.params }}
|
||||
env:
|
||||
CERTORAKEY: ${{ secrets.CERTORAKEY }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
params: ${{ fromJson(needs.list-scripts.outputs.matrix) }}
|
||||
214
.github/workflows/release-cycle.yml
vendored
Normal file
214
.github/workflows/release-cycle.yml
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
# D: Manual Dispatch
|
||||
# M: Merge release PR
|
||||
# C: Commit
|
||||
# ┌───────────┐ ┌─────────────┐ ┌────────────────┐
|
||||
# │Development├──D──►RC-Unreleased│ ┌──►Final-Unreleased│
|
||||
# └───────────┘ └─┬─────────▲─┘ │ └─┬────────────▲─┘
|
||||
# │ │ │ │ │
|
||||
# M C D M C
|
||||
# │ │ │ │ │
|
||||
# ┌▼─────────┴┐ │ ┌▼────────────┴┐
|
||||
# │RC-Released├───┘ │Final-Released│
|
||||
# └───────────┘ └──────────────┘
|
||||
name: Release Cycle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release-v*
|
||||
workflow_dispatch: {}
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
state:
|
||||
name: Check state
|
||||
permissions:
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- id: state
|
||||
name: Get state
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: await require('./scripts/release/workflow/state.js')({ github, context, core })
|
||||
outputs:
|
||||
# Job Flags
|
||||
start: ${{ steps.state.outputs.start }}
|
||||
changesets: ${{ steps.state.outputs.changesets }}
|
||||
promote: ${{ steps.state.outputs.promote }}
|
||||
publish: ${{ steps.state.outputs.publish }}
|
||||
merge: ${{ steps.state.outputs.merge }}
|
||||
|
||||
# Global variables
|
||||
is_prerelease: ${{ steps.state.outputs.is_prerelease }}
|
||||
|
||||
start:
|
||||
needs: state
|
||||
name: Start new release candidate
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
if: needs.state.outputs.start == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
- id: start
|
||||
name: Create branch with release candidate
|
||||
run: bash scripts/release/workflow/start.sh
|
||||
- name: Re-run workflow
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
REF: ${{ steps.start.outputs.branch }}
|
||||
with:
|
||||
script: await require('./scripts/release/workflow/rerun.js')({ github, context })
|
||||
|
||||
promote:
|
||||
needs: state
|
||||
name: Promote to final release
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
if: needs.state.outputs.promote == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
- name: Exit prerelease state
|
||||
if: needs.state.outputs.is_prerelease == 'true'
|
||||
run: bash scripts/release/workflow/exit-prerelease.sh
|
||||
- name: Re-run workflow
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: await require('./scripts/release/workflow/rerun.js')({ github, context })
|
||||
|
||||
changesets:
|
||||
needs: state
|
||||
name: Update PR to release
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: needs.state.outputs.changesets == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # To get all tags
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- name: Set release title
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
result-encoding: string
|
||||
script: await require('./scripts/release/workflow/set-changesets-pr-title.js')({ core })
|
||||
- name: Create PR
|
||||
uses: changesets/action@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PRERELEASE: ${{ needs.state.outputs.is_prerelease }}
|
||||
with:
|
||||
version: npm run version
|
||||
title: ${{ env.TITLE }}
|
||||
commit: ${{ env.TITLE }}
|
||||
body: | # Wait for support on this https://github.com/changesets/action/pull/250
|
||||
This is an automated PR for releasing ${{ github.repository }}
|
||||
Check [CHANGELOG.md](${{ github.repository }}/CHANGELOG.md)
|
||||
|
||||
publish:
|
||||
needs: state
|
||||
name: Publish to npm
|
||||
environment: npm
|
||||
permissions:
|
||||
contents: write
|
||||
if: needs.state.outputs.publish == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- id: pack
|
||||
name: Pack
|
||||
run: bash scripts/release/workflow/pack.sh
|
||||
env:
|
||||
PRERELEASE: ${{ needs.state.outputs.is_prerelease }}
|
||||
- name: Upload tarball artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ github.ref_name }}
|
||||
path: ${{ steps.pack.outputs.tarball }}
|
||||
- name: Tag
|
||||
run: npx changeset tag
|
||||
- name: Publish
|
||||
run: bash scripts/release/workflow/publish.sh
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
TARBALL: ${{ steps.pack.outputs.tarball }}
|
||||
TAG: ${{ steps.pack.outputs.tag }}
|
||||
- name: Push tags
|
||||
run: git push --tags
|
||||
- name: Create Github Release
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
PRERELEASE: ${{ needs.state.outputs.is_prerelease }}
|
||||
with:
|
||||
script: await require('./scripts/release/workflow/github-release.js')({ github, context })
|
||||
outputs:
|
||||
tarball_name: ${{ steps.pack.outputs.tarball_name }}
|
||||
|
||||
integrity_check:
|
||||
needs: publish
|
||||
name: Tarball Integrity Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Download tarball artifact
|
||||
id: artifact
|
||||
# Replace with actions/upload-artifact@v3 when
|
||||
# https://github.com/actions/download-artifact/pull/194 gets released
|
||||
uses: actions/download-artifact@e9ef242655d12993efdcda9058dee2db83a2cb9b
|
||||
with:
|
||||
name: ${{ github.ref_name }}
|
||||
- name: Check integrity
|
||||
run: bash scripts/release/workflow/integrity-check.sh
|
||||
env:
|
||||
TARBALL: ${{ steps.artifact.outputs.download-path }}/${{ needs.publish.outputs.tarball_name }}
|
||||
|
||||
merge:
|
||||
needs: state
|
||||
name: Create PR back to master
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: needs.state.outputs.merge == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # All branches
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
- name: Create branch to merge
|
||||
run: bash scripts/release/workflow/prepare-release-merge.sh
|
||||
- name: Create PR back to master
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
await github.rest.pulls.create({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
head: 'merge/${{ github.ref_name }}',
|
||||
base: 'master',
|
||||
title: '${{ format('Merge {0} branch', github.ref_name) }}'
|
||||
});
|
||||
23
.github/workflows/upgradeable.yml
vendored
Normal file
23
.github/workflows/upgradeable.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
name: Upgradeable Trigger
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-v*
|
||||
|
||||
jobs:
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: app
|
||||
uses: getsentry/action-github-app-token@v2
|
||||
with:
|
||||
app_id: ${{ secrets.UPGRADEABLE_APP_ID }}
|
||||
private_key: ${{ secrets.UPGRADEABLE_APP_PK }}
|
||||
- run: |
|
||||
curl -X POST \
|
||||
https://api.github.com/repos/OpenZeppelin/openzeppelin-contracts-upgradeable/dispatches \
|
||||
-H 'Accept: application/vnd.github.v3+json' \
|
||||
-H 'Authorization: token ${{ steps.app.outputs.token }}' \
|
||||
-d '{ "event_type": "Update", "client_payload": { "ref": "${{ github.ref }}" } }'
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@ -50,3 +50,22 @@ contracts/README.md
|
||||
|
||||
# temporary artifact from solidity-coverage
|
||||
allFiredEvents
|
||||
.coverage_artifacts
|
||||
.coverage_cache
|
||||
.coverage_contracts
|
||||
|
||||
# hardat-exposed
|
||||
contracts-exposed
|
||||
|
||||
# Hardhat
|
||||
/cache
|
||||
/artifacts
|
||||
|
||||
# Foundry
|
||||
/out
|
||||
|
||||
# Certora
|
||||
.certora*
|
||||
.last_confs
|
||||
certora_*
|
||||
resource_errors.json
|
||||
|
||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
[submodule "lib/forge-std"]
|
||||
path = lib/forge-std
|
||||
url = https://github.com/foundry-rs/forge-std
|
||||
[submodule "lib/erc4626-tests"]
|
||||
path = lib/erc4626-tests
|
||||
url = https://github.com/a16z/erc4626-tests.git
|
||||
4
.mocharc.js
Normal file
4
.mocharc.js
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
require: 'hardhat/register',
|
||||
timeout: 4000,
|
||||
};
|
||||
14
.prettierrc
Normal file
14
.prettierrc
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"printWidth": 120,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"arrowParens": "avoid",
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.sol",
|
||||
"options": {
|
||||
"singleQuote": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
19
.solcover.js
19
.solcover.js
@ -1,8 +1,13 @@
|
||||
module.exports = {
|
||||
norpc: true,
|
||||
testCommand: 'npm test',
|
||||
compileCommand: 'npm run compile',
|
||||
skipFiles: [
|
||||
'mocks',
|
||||
]
|
||||
}
|
||||
norpc: true,
|
||||
testCommand: 'npm test',
|
||||
compileCommand: 'npm run compile',
|
||||
skipFiles: ['mocks'],
|
||||
providerOptions: {
|
||||
default_balance_ether: '10000000000000000000000000',
|
||||
},
|
||||
mocha: {
|
||||
fgrep: '[skip-on-coverage]',
|
||||
invert: true,
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
{
|
||||
"extends": "solhint:recommended",
|
||||
"rules": {
|
||||
"func-order": "off",
|
||||
"mark-callable-contracts": "off",
|
||||
"no-empty-blocks": "off",
|
||||
"compiler-version": ["error", "^0.6.0"],
|
||||
"private-vars-leading-underscore": "error"
|
||||
"no-unused-vars": "error",
|
||||
"const-name-snakecase": "error",
|
||||
"contract-name-camelcase": "error",
|
||||
"event-name-camelcase": "error",
|
||||
"func-name-mixedcase": "error",
|
||||
"func-param-name-mixedcase": "error",
|
||||
"modifier-name-mixedcase": "error",
|
||||
"private-vars-leading-underscore": "error",
|
||||
"var-name-mixedcase": "error",
|
||||
"imports-on-top": "error"
|
||||
}
|
||||
}
|
||||
|
||||
683
CHANGELOG.md
683
CHANGELOG.md
@ -1,101 +1,567 @@
|
||||
# Changelog
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `EIP712`: Addition of ERC5267 support requires support for user defined value types, which was released in Solidity version 0.8.8. This requires a pragma change from `^0.8.0` to `^0.8.8`.
|
||||
- `EIP712`: Optimization of the cache for the upgradeable version affects the way `name` and `version` are set. This is no longer done through an initializer, and is instead part of the implementation's constructor. As a consequence, all proxies using the same implementation will necessarily share the same `name` and `version`. Additionally, an implementation upgrade risks changing the EIP712 domain unless the same `name` and `version` are used when deploying the new implementation contract.
|
||||
|
||||
### Deprecations
|
||||
|
||||
- `ERC20Permit`: Added the file `IERC20Permit.sol` and `ERC20Permit.sol` and deprecated `draft-IERC20Permit.sol` and `draft-ERC20Permit.sol` since [EIP-2612](https://eips.ethereum.org/EIPS/eip-2612) is no longer a Draft. Developers are encouraged to update their imports. ([#3793](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3793))
|
||||
- `Timers`: The `Timers` library is now deprecated and will be removed in the next major release. ([#4062](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4062))
|
||||
- `ERC777`: The `ERC777` token standard is no longer supported by OpenZeppelin. Our implementation is now deprecated and will be removed in the next major release. The corresponding standard interfaces remain available. ([#4066](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4066))
|
||||
- `ERC1820Implementer`: The `ERC1820` pseudo-introspection mechanism is no longer supported by OpenZeppelin. Our implementation is now deprecated and will be removed in the next major release. The corresponding standard interfaces remain available. ([#4066](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4066))
|
||||
|
||||
## 4.8.1 (2023-01-12)
|
||||
|
||||
- `ERC4626`: Use staticcall instead of call when fetching underlying ERC-20 decimals. ([#3943](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3943))
|
||||
|
||||
## 4.8.0 (2022-11-08)
|
||||
|
||||
- `TimelockController`: Added a new `admin` constructor parameter that is assigned the admin role instead of the deployer account. ([#3722](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3722))
|
||||
- `Initializable`: add internal functions `_getInitializedVersion` and `_isInitializing` ([#3598](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3598))
|
||||
- `ERC165Checker`: add `supportsERC165InterfaceUnchecked` for consulting individual interfaces without the full ERC165 protocol. ([#3339](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3339))
|
||||
- `Address`: optimize `functionCall` by calling `functionCallWithValue` directly. ([#3468](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3468))
|
||||
- `Address`: optimize `functionCall` functions by checking contract size only if there is no returned data. ([#3469](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3469))
|
||||
- `Governor`: make the `relay` function payable, and add support for EOA payments. ([#3730](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3730))
|
||||
- `GovernorCompatibilityBravo`: remove unused `using` statements. ([#3506](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3506))
|
||||
- `ERC20`: optimize `_transfer`, `_mint` and `_burn` by using `unchecked` arithmetic when possible. ([#3513](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3513))
|
||||
- `ERC20Votes`, `ERC721Votes`: optimize `getPastVotes` for looking up recent checkpoints. ([#3673](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3673))
|
||||
- `ERC20FlashMint`: add an internal `_flashFee` function for overriding. ([#3551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3551))
|
||||
- `ERC4626`: use the same `decimals()` as the underlying asset by default (if available). ([#3639](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3639))
|
||||
- `ERC4626`: add internal `_initialConvertToShares` and `_initialConvertToAssets` functions to customize empty vaults behavior. ([#3639](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3639))
|
||||
- `ERC721`: optimize transfers by making approval clearing implicit instead of emitting an event. ([#3481](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3481))
|
||||
- `ERC721`: optimize burn by making approval clearing implicit instead of emitting an event. ([#3538](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3538))
|
||||
- `ERC721`: Fix balance accounting when a custom `_beforeTokenTransfer` hook results in a transfer of the token under consideration. ([#3611](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3611))
|
||||
- `ERC721`: use unchecked arithmetic for balance updates. ([#3524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3524))
|
||||
- `ERC721Consecutive`: Implementation of EIP-2309 that allows batch minting of ERC721 tokens during construction. ([#3311](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3311))
|
||||
- `ReentrancyGuard`: Reduce code size impact of the modifier by using internal functions. ([#3515](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3515))
|
||||
- `SafeCast`: optimize downcasting of signed integers. ([#3565](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3565))
|
||||
- `ECDSA`: Remove redundant check on the `v` value. ([#3591](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3591))
|
||||
- `VestingWallet`: add `releasable` getters. ([#3580](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3580))
|
||||
- `VestingWallet`: remove unused library `Math.sol`. ([#3605](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3605))
|
||||
- `VestingWallet`: make constructor payable. ([#3665](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3665))
|
||||
- `Create2`: optimize address computation by using assembly instead of `abi.encodePacked`. ([#3600](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3600))
|
||||
- `Clones`: optimized the assembly to use only the scratch space during deployments, and optimized `predictDeterministicAddress` to use fewer operations. ([#3640](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3640))
|
||||
- `Checkpoints`: Use procedural generation to support multiple key/value lengths. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
|
||||
- `Checkpoints`: Add new lookup mechanisms. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
|
||||
- `Arrays`: Add `unsafeAccess` functions that allow reading and writing to an element in a storage array bypassing Solidity's "out-of-bounds" check. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
|
||||
- `Strings`: optimize `toString`. ([#3573](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3573))
|
||||
- `Ownable2Step`: extension of `Ownable` that makes the ownership transfers a two step process. ([#3620](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3620))
|
||||
- `Math` and `SignedMath`: optimize function `max` by using `>` instead of `>=`. ([#3679](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3679))
|
||||
- `Math`: Add `log2`, `log10` and `log256`. ([#3670](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3670))
|
||||
- Arbitrum: Update the vendored arbitrum contracts to match the nitro upgrade. ([#3692](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3692))
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `ERC721`: In order to add support for batch minting via `ERC721Consecutive` it was necessary to make a minor breaking change in the internal interface of `ERC721`. Namely, the hooks `_beforeTokenTransfer` and `_afterTokenTransfer` have one additional argument that may need to be added to overrides:
|
||||
|
||||
```diff
|
||||
function _beforeTokenTransfer(
|
||||
address from,
|
||||
address to,
|
||||
uint256 tokenId,
|
||||
+ uint256 batchSize
|
||||
) internal virtual override
|
||||
```
|
||||
|
||||
- `ERC4626`: Conversion from shares to assets (and vice-versa) in an empty vault used to consider the possible mismatch between the underlying asset's and the vault's decimals. This initial conversion rate is now set to 1-to-1 irrespective of decimals, which are meant for usability purposes only. The vault now uses the assets decimals by default, so off-chain the numbers should appear the same. Developers overriding the vault decimals to a value that does not match the underlying asset may want to override the `_initialConvertToShares` and `_initialConvertToAssets` to replicate the previous behavior.
|
||||
|
||||
- `TimelockController`: During deployment, the TimelockController used to grant the `TIMELOCK_ADMIN_ROLE` to the deployer and to the timelock itself. The deployer was then expected to renounce this role once configuration of the timelock is over. Failing to renounce that role allows the deployer to change the timelock permissions (but not to bypass the delay for any time-locked actions). The role is no longer given to the deployer by default. A new parameter `admin` can be set to a non-zero address to grant the admin role during construction (to the deployer or any other address). Just like previously, this admin role should be renounced after configuration. If this param is given `address(0)`, the role is not allocated and doesn't need to be revoked. In any case, the timelock itself continues to have this role.
|
||||
|
||||
### Deprecations
|
||||
|
||||
- `EIP712`: Added the file `EIP712.sol` and deprecated `draft-EIP712.sol` since the EIP is no longer a Draft. Developers are encouraged to update their imports. ([#3621](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3621))
|
||||
|
||||
```diff
|
||||
-import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
|
||||
+import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
|
||||
```
|
||||
|
||||
- `ERC721Votes`: Added the file `ERC721Votes.sol` and deprecated `draft-ERC721Votes.sol` since it no longer depends on a Draft EIP (EIP-712). Developers are encouraged to update their imports. ([#3699](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3699))
|
||||
|
||||
```diff
|
||||
-import "@openzeppelin/contracts/token/ERC721/extensions/draft-ERC721Votes.sol";
|
||||
+import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol";
|
||||
```
|
||||
|
||||
### ERC-721 Compatibility Note
|
||||
|
||||
ERC-721 integrators that interpret contract state from events should make sure that they implement the clearing of approval that is implicit in every transfer according to the EIP. Previous versions of OpenZeppelin Contracts emitted an explicit `Approval` event even though it was not required by the specification, and this is no longer the case.
|
||||
|
||||
With the new `ERC721Consecutive` extension, the internal workings of `ERC721` are slightly changed. Custom extensions to ERC721 should be reviewed to ensure they remain correct. The internal functions that should be considered are `_ownerOf` (new), `_beforeTokenTransfer`, and `_afterTokenTransfer`.
|
||||
|
||||
### ERC-4626 Upgrade Note
|
||||
|
||||
Existing `ERC4626` contracts that are upgraded to 4.8 must initialize a new variable that holds the vault token decimals. The recommended way to do this is to use a [reinitializer]:
|
||||
|
||||
[reinitializer]: https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable-reinitializer-uint8-
|
||||
|
||||
```solidity
|
||||
function migrateToV48() public reinitializer(2) {
|
||||
__ERC4626_init(IERC20Upgradeable(asset()));
|
||||
}
|
||||
```
|
||||
|
||||
## 4.7.3 (2022-08-10)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `ECDSA`: `recover(bytes32,bytes)` and `tryRecover(bytes32,bytes)` no longer accept compact signatures to prevent malleability. Compact signature support remains available using `recover(bytes32,bytes32,bytes32)` and `tryRecover(bytes32,bytes32,bytes32)`.
|
||||
|
||||
## 4.7.2 (2022-07-25)
|
||||
|
||||
- `LibArbitrumL2`, `CrossChainEnabledArbitrumL2`: Fixed detection of cross-chain calls for EOAs. Previously, calls from EOAs would be classified as cross-chain calls. ([#3578](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3578))
|
||||
- `GovernorVotesQuorumFraction`: Fixed quorum updates so they do not affect past proposals that failed due to lack of quorum. ([#3561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3561))
|
||||
- `ERC165Checker`: Added protection against large returndata. ([#3587](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3587))
|
||||
|
||||
## 4.7.1 (2022-07-18)
|
||||
|
||||
- `SignatureChecker`: Fix an issue that causes `isValidSignatureNow` to revert when the target contract returns ill-encoded data. ([#3552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552))
|
||||
- `ERC165Checker`: Fix an issue that causes `supportsInterface` to revert when the target contract returns ill-encoded data. ([#3552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552))
|
||||
|
||||
## 4.7.0 (2022-06-29)
|
||||
|
||||
- `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317))
|
||||
- `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380))
|
||||
- `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327))
|
||||
- `ERC4626`: add an extension of `ERC20` that implements the ERC4626 Tokenized Vault Standard. ([#3171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3171))
|
||||
- `SafeERC20`: add `safePermit` as mitigation against phantom permit functions. ([#3280](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3280))
|
||||
- `Math`: add a `mulDiv` function that can round the result either up or down. ([#3171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3171))
|
||||
- `Math`: Add a `sqrt` function to compute square roots of integers, rounding either up or down. ([#3242](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3242))
|
||||
- `Strings`: add a new overloaded function `toHexString` that converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. ([#3403](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3403))
|
||||
- `EnumerableMap`: add new `UintToUintMap` map type. ([#3338](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3338))
|
||||
- `EnumerableMap`: add new `Bytes32ToUintMap` map type. ([#3416](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3416))
|
||||
- `SafeCast`: add support for many more types, using procedural code generation. ([#3245](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3245))
|
||||
- `MerkleProof`: add `multiProofVerify` to prove multiple values are part of a Merkle tree. ([#3276](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3276))
|
||||
- `MerkleProof`: add calldata versions of the functions to avoid copying input arrays to memory and save gas. ([#3200](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3200))
|
||||
- `ERC721`, `ERC1155`: simplified revert reasons. ([#3254](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3254), ([#3438](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3438)))
|
||||
- `ERC721`: removed redundant require statement. ([#3434](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3434))
|
||||
- `PaymentSplitter`: add `releasable` getters. ([#3350](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3350))
|
||||
- `Initializable`: refactored implementation of modifiers for easier understanding. ([#3450](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3450))
|
||||
- `Proxies`: remove runtime check of ERC1967 storage slots. ([#3455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3455))
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `Initializable`: functions decorated with the modifier `reinitializer(1)` may no longer invoke each other.
|
||||
|
||||
## 4.6.0 (2022-04-26)
|
||||
|
||||
- `crosschain`: Add a new set of contracts for cross-chain applications. `CrossChainEnabled` is a base contract with instantiations for several chains and bridges, and `AccessControlCrossChain` is an extension of access control that allows cross-chain operation. ([#3183](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3183))
|
||||
- `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137))
|
||||
- `EnumerableMap`: add new `AddressToUintMap` map type. ([#3150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3150))
|
||||
- `EnumerableMap`: add new `Bytes32ToBytes32Map` map type. ([#3192](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3192))
|
||||
- `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226))
|
||||
- `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259))
|
||||
- `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196))
|
||||
- `ERC1155`: Add a `_afterTokenTransfer` hook for improved extensibility. ([#3166](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3166))
|
||||
- `ERC1155URIStorage`: add a new extension that implements a `_setURI` behavior similar to ERC721's `_setTokenURI`. ([#3210](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3210))
|
||||
- `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153))
|
||||
- `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147))
|
||||
- `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
|
||||
- `Governor`: rewording of revert reason for consistency. ([#3275](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3275))
|
||||
- `Governor`: fix an inconsistency in data locations that could lead to invalid bytecode being produced. ([#3295](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3295))
|
||||
- `Governor`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by governors. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230))
|
||||
- `TimelockController`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by timelocks. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230))
|
||||
- `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165))
|
||||
- `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232))
|
||||
- `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294))
|
||||
- `ERC2981`: make `royaltyInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305))
|
||||
|
||||
### Upgradeability notice
|
||||
|
||||
- `TimelockController`: **(Action needed)** The upgrade from <4.6 to >=4.6 introduces a new `CANCELLER_ROLE` that requires set up to be assignable. After the upgrade, only addresses with this role will have the ability to cancel. Proposers will no longer be able to cancel. Assigning cancellers can be done by an admin (including the timelock itself) once the role admin is set up. To do this, we recommend upgrading to the `TimelockControllerWith46MigrationUpgradeable` contract and then calling the `migrateTo46` function.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `Governor`: Adds internal virtual `_getVotes` method that must be implemented; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing voting module extension, rename `getVotes` to `_getVotes` and add a `bytes memory` argument. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
|
||||
- `Governor`: Adds `params` parameter to internal virtual `_countVote` method; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing counting module extension, add a `bytes memory` argument to `_countVote`. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
|
||||
- `Governor`: Does not emit `VoteCast` event when params data is non-empty; instead emits `VoteCastWithParams` event. To fix this on an integration that consumes the `VoteCast` event, also fetch/monitor `VoteCastWithParams` events. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
|
||||
- `Votes`: The internal virtual function `_getVotingUnits` was made `view` (which was accidentally missing). Any overrides should now be updated so they are `view` as well.
|
||||
|
||||
## 4.5.0 (2022-02-09)
|
||||
|
||||
- `ERC2981`: add implementation of the royalty standard, and the respective extensions for `ERC721` and `ERC1155`. ([#3012](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3012))
|
||||
- `GovernorTimelockControl`: improve the `state()` function to have it reflect cases where a proposal has been canceled directly on the timelock. ([#2977](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2977))
|
||||
- Preset contracts are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com). ([#2986](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2986))
|
||||
- `Governor`: add a relay function to help recover assets sent to a governor that is not its own executor (e.g. when using a timelock). ([#2926](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2926))
|
||||
- `GovernorPreventLateQuorum`: add new module to ensure a minimum voting duration is available after the quorum is reached. ([#2973](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2973))
|
||||
- `ERC721`: improved revert reason when transferring from wrong owner. ([#2975](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2975))
|
||||
- `Votes`: Added a base contract for vote tracking with delegation. ([#2944](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2944))
|
||||
- `ERC721Votes`: Added an extension of ERC721 enabled with vote tracking and delegation. ([#2944](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2944))
|
||||
- `ERC2771Context`: use immutable storage to store the forwarder address, no longer an issue since Solidity >=0.8.8 allows reading immutable variables in the constructor. ([#2917](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2917))
|
||||
- `Base64`: add a library to parse bytes into base64 strings using `encode(bytes memory)` function, and provide examples to show how to use to build URL-safe `tokenURIs`. ([#2884](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2884))
|
||||
- `ERC20`: reduce allowance before triggering transfer. ([#3056](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3056))
|
||||
- `ERC20`: do not update allowance on `transferFrom` when allowance is `type(uint256).max`. ([#3085](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3085))
|
||||
- `ERC20`: add a `_spendAllowance` internal function. ([#3170](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3170))
|
||||
- `ERC20Burnable`: do not update allowance on `burnFrom` when allowance is `type(uint256).max`. ([#3170](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3170))
|
||||
- `ERC777`: do not update allowance on `transferFrom` when allowance is `type(uint256).max`. ([#3085](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3085))
|
||||
- `ERC777`: add a `_spendAllowance` internal function. ([#3170](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3170))
|
||||
- `SignedMath`: a new signed version of the Math library with `max`, `min`, and `average`. ([#2686](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2686))
|
||||
- `SignedMath`: add an `abs(int256)` method that returns the unsigned absolute value of a signed value. ([#2984](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2984))
|
||||
- `ERC1967Upgrade`: Refactor the secure upgrade to use `ERC1822` instead of the previous rollback mechanism. This reduces code complexity and attack surface with similar security guarantees. ([#3021](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3021))
|
||||
- `UUPSUpgradeable`: Add `ERC1822` compliance to support the updated secure upgrade mechanism. ([#3021](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3021))
|
||||
- Some more functions have been made virtual to customize them via overrides. In many cases this will not imply that other functions in the contract will automatically adapt to the overridden definitions. People who wish to override should consult the source code to understand the impact and if they need to override any additional functions to achieve the desired behavior.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `ERC1967Upgrade`: The function `_upgradeToAndCallSecure` was renamed to `_upgradeToAndCallUUPS`, along with the change in security mechanism described above.
|
||||
- `Address`: The Solidity pragma is increased from `^0.8.0` to `^0.8.1`. This is required by the `account.code.length` syntax that replaces inline assembly. This may require users to bump their compiler version from `0.8.0` to `0.8.1` or later. Note that other parts of the code already include stricter requirements.
|
||||
|
||||
## 4.4.2 (2022-01-11)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- `GovernorCompatibilityBravo`: Fix error in the encoding of calldata for proposals submitted through the compatibility interface with explicit signatures. ([#3100](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3100))
|
||||
|
||||
## 4.4.1 (2021-12-14)
|
||||
|
||||
- `Initializable`: change the existing `initializer` modifier and add a new `onlyInitializing` modifier to prevent reentrancy risk. ([#3006](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3006))
|
||||
|
||||
### Breaking change
|
||||
|
||||
It is no longer possible to call an `initializer`-protected function from within another `initializer` function outside the context of a constructor. Projects using OpenZeppelin upgradeable proxies should continue to work as is, since in the common case the initializer is invoked in the constructor directly. If this is not the case for you, the suggested change is to use the new `onlyInitializing` modifier in the following way:
|
||||
|
||||
```diff
|
||||
contract A {
|
||||
- function initialize() public initializer { ... }
|
||||
+ function initialize() internal onlyInitializing { ... }
|
||||
}
|
||||
contract B is A {
|
||||
function initialize() public initializer {
|
||||
A.initialize();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 4.4.0 (2021-11-25)
|
||||
|
||||
- `Ownable`: add an internal `_transferOwnership(address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
|
||||
- `AccessControl`: add internal `_grantRole(bytes32,address)` and `_revokeRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
|
||||
- `AccessControl`: mark `_setupRole(bytes32,address)` as deprecated in favor of `_grantRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
|
||||
- `AccessControlEnumerable`: hook into `_grantRole(bytes32,address)` and `_revokeRole(bytes32,address)`. ([#2946](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2946))
|
||||
- `EIP712`: cache `address(this)` to immutable storage to avoid potential issues if a vanilla contract is used in a delegatecall context. ([#2852](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2852))
|
||||
- Add internal `_setApprovalForAll` to `ERC721` and `ERC1155`. ([#2834](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2834))
|
||||
- `Governor`: shift vote start and end by one block to better match Compound's GovernorBravo and prevent voting at the Governor level if the voting snapshot is not ready. ([#2892](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2892))
|
||||
- `GovernorCompatibilityBravo`: consider quorum an inclusive rather than exclusive minimum to match Compound's GovernorBravo. ([#2974](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2974))
|
||||
- `GovernorSettings`: a new governor module that manages voting settings updatable through governance actions. ([#2904](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2904))
|
||||
- `PaymentSplitter`: now supports ERC20 assets in addition to Ether. ([#2858](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2858))
|
||||
- `ECDSA`: add a variant of `toEthSignedMessageHash` for arbitrary length message hashing. ([#2865](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2865))
|
||||
- `MerkleProof`: add a `processProof` function that returns the rebuilt root hash given a leaf and a proof. ([#2841](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2841))
|
||||
- `VestingWallet`: new contract that handles the vesting of Ether and ERC20 tokens following a customizable vesting schedule. ([#2748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2748))
|
||||
- `Governor`: enable receiving Ether when a Timelock contract is not used. ([#2849](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2849))
|
||||
- `GovernorTimelockCompound`: fix ability to use Ether stored in the Timelock contract. ([#2849](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2849))
|
||||
|
||||
## 4.3.3 (2021-11-08)
|
||||
|
||||
- `ERC1155Supply`: Handle `totalSupply` changes by hooking into `_beforeTokenTransfer` to ensure consistency of balances and supply during `IERC1155Receiver.onERC1155Received` calls.
|
||||
|
||||
## 4.3.2 (2021-09-14)
|
||||
|
||||
- `UUPSUpgradeable`: Add modifiers to prevent `upgradeTo` and `upgradeToAndCall` being executed on any contract that is not the active ERC1967 proxy. This prevents these functions being called on implementation contracts or minimal ERC1167 clones, in particular.
|
||||
|
||||
## 4.3.1 (2021-08-26)
|
||||
|
||||
- `TimelockController`: Add additional isOperationReady check.
|
||||
|
||||
## 4.3.0 (2021-08-17)
|
||||
|
||||
- `ERC2771Context`: use private variable from storage to store the forwarder address. Fixes issues where `_msgSender()` was not callable from constructors. ([#2754](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2754))
|
||||
- `EnumerableSet`: add `values()` functions that returns an array containing all values in a single call. ([#2768](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2768))
|
||||
- `Governor`: added a modular system of `Governor` contracts based on `GovernorAlpha` and `GovernorBravo`. ([#2672](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2672))
|
||||
- Add an `interfaces` folder containing solidity interfaces to final ERCs. ([#2517](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2517))
|
||||
- `ECDSA`: add `tryRecover` functions that will not throw if the signature is invalid, and will return an error flag instead. ([#2661](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2661))
|
||||
- `SignatureChecker`: Reduce gas usage of the `isValidSignatureNow` function for the "signature by EOA" case. ([#2661](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2661))
|
||||
|
||||
## 4.2.0 (2021-06-30)
|
||||
|
||||
- `ERC20Votes`: add a new extension of the `ERC20` token with support for voting snapshots and delegation. ([#2632](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2632))
|
||||
- `ERC20VotesComp`: Variant of `ERC20Votes` that is compatible with Compound's `Comp` token interface but restricts supply to `uint96`. ([#2706](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2706))
|
||||
- `ERC20Wrapper`: add a new extension of the `ERC20` token which wraps an underlying token. Deposit and withdraw guarantee that the total supply is backed by a corresponding amount of underlying token. ([#2633](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2633))
|
||||
- Enumerables: Improve gas cost of removal in `EnumerableSet` and `EnumerableMap`.
|
||||
- Enumerables: Improve gas cost of lookup in `EnumerableSet` and `EnumerableMap`.
|
||||
- `Counter`: add a reset method. ([#2678](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2678))
|
||||
- Tokens: Wrap definitely safe subtractions in `unchecked` blocks.
|
||||
- `Math`: Add a `ceilDiv` method for performing ceiling division.
|
||||
- `ERC1155Supply`: add a new `ERC1155` extension that keeps track of the totalSupply of each tokenId. ([#2593](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2593))
|
||||
- `BitMaps`: add a new `BitMaps` library that provides a storage efficient datastructure for `uint256` to `bool` mapping with contiguous keys. ([#2710](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2710))
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- `ERC20FlashMint` is no longer a Draft ERC. ([#2673](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2673)))
|
||||
|
||||
**How to update:** Change your import paths by removing the `draft-` prefix from `@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol`.
|
||||
|
||||
> See [Releases and Stability: Drafts](https://docs.openzeppelin.com/contracts/4.x/releases-stability#drafts).
|
||||
|
||||
## 4.1.0 (2021-04-29)
|
||||
|
||||
- `IERC20Metadata`: add a new extended interface that includes the optional `name()`, `symbol()` and `decimals()` functions. ([#2561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2561))
|
||||
- `ERC777`: make reception acquirement optional in `_mint`. ([#2552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2552))
|
||||
- `ERC20Permit`: add a `_useNonce` to enable further usage of ERC712 signatures. ([#2565](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2565))
|
||||
- `ERC20FlashMint`: add an implementation of the ERC3156 extension for flash-minting ERC20 tokens. ([#2543](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2543))
|
||||
- `SignatureChecker`: add a signature verification library that supports both EOA and ERC1271 compliant contracts as signers. ([#2532](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2532))
|
||||
- `Multicall`: add abstract contract with `multicall(bytes[] calldata data)` function to bundle multiple calls together ([#2608](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2608))
|
||||
- `ECDSA`: add support for ERC2098 short-signatures. ([#2582](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2582))
|
||||
- `AccessControl`: add an `onlyRole` modifier to restrict specific function to callers bearing a specific role. ([#2609](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2609))
|
||||
- `StorageSlot`: add a library for reading and writing primitive types to specific storage slots. ([#2542](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2542))
|
||||
- UUPS Proxies: add `UUPSUpgradeable` to implement the UUPS proxy pattern together with `EIP1967Proxy`. ([#2542](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2542))
|
||||
|
||||
### Breaking changes
|
||||
|
||||
This release includes two small breaking changes in `TimelockController`.
|
||||
|
||||
1. The `onlyRole` modifier in this contract was designed to let anyone through if the role was granted to `address(0)`,
|
||||
allowing the possibility to to make a role "open", which can be used for `EXECUTOR_ROLE`. This modifier is now
|
||||
replaced by `AccessControl.onlyRole`, which does not have this ability. The previous behavior was moved to the
|
||||
modifier `TimelockController.onlyRoleOrOpenRole`.
|
||||
2. It was possible to make `PROPOSER_ROLE` an open role (as described in the previous item) if it was granted to
|
||||
`address(0)`. This would affect the `schedule`, `scheduleBatch`, and `cancel` operations in `TimelockController`.
|
||||
This ability was removed as it does not make sense to open up the `PROPOSER_ROLE` in the same way that it does for
|
||||
`EXECUTOR_ROLE`.
|
||||
|
||||
## 4.0.0 (2021-03-23)
|
||||
|
||||
- Now targeting the 0.8.x line of Solidity compilers. For 0.6.x (resp 0.7.x) support, use version 3.4.0 (resp 3.4.0-solc-0.7) of OpenZeppelin.
|
||||
- `Context`: making `_msgData` return `bytes calldata` instead of `bytes memory` ([#2492](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2492))
|
||||
- `ERC20`: removed the `_setDecimals` function and the storage slot associated to decimals. ([#2502](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2502))
|
||||
- `Strings`: addition of a `toHexString` function. ([#2504](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2504))
|
||||
- `EnumerableMap`: change implementation to optimize for `key → value` lookups instead of enumeration. ([#2518](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2518))
|
||||
- `GSN`: deprecate GSNv1 support in favor of upcoming support for GSNv2. ([#2521](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2521))
|
||||
- `ERC165`: remove uses of storage in the base ERC165 implementation. ERC165 based contracts now use storage-less virtual functions. Old behavior remains available in the `ERC165Storage` extension. ([#2505](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2505))
|
||||
- `Initializable`: make initializer check stricter during construction. ([#2531](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2531))
|
||||
- `ERC721`: remove enumerability of tokens from the base implementation. This feature is now provided separately through the `ERC721Enumerable` extension. ([#2511](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2511))
|
||||
- `AccessControl`: removed enumerability by default for a more lightweight contract. It is now opt-in through `AccessControlEnumerable`. ([#2512](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2512))
|
||||
- Meta Transactions: add `ERC2771Context` and a `MinimalForwarder` for meta-transactions. ([#2508](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2508))
|
||||
- Overall reorganization of the contract folder to improve clarity and discoverability. ([#2503](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2503))
|
||||
- `ERC20Capped`: optimize gas usage by enforcing the check directly in `_mint`. ([#2524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2524))
|
||||
- Rename `UpgradeableProxy` to `ERC1967Proxy`. ([#2547](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2547))
|
||||
- `ERC777`: optimize the gas costs of the constructor. ([#2551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2551))
|
||||
- `ERC721URIStorage`: add a new extension that implements the `_setTokenURI` behavior as it was available in 3.4.0. ([#2555](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2555))
|
||||
- `AccessControl`: added ERC165 interface detection. ([#2562](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2562))
|
||||
- `ERC1155`: make `uri` public so overloading function can call it using super. ([#2576](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2576))
|
||||
|
||||
### Bug fixes for beta releases
|
||||
|
||||
- `AccessControlEnumerable`: Fixed `renounceRole` not updating enumerable set of addresses for a role. ([#2572](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2572))
|
||||
|
||||
### How to upgrade from 3.x
|
||||
|
||||
Since this version has moved a few contracts to different directories, users upgrading from a previous version will need to adjust their import statements. To make this easier, the package includes a script that will migrate import statements automatically. After upgrading to the latest version of the package, run:
|
||||
|
||||
```
|
||||
npx openzeppelin-contracts-migrate-imports
|
||||
```
|
||||
|
||||
Make sure you're using git or another version control system to be able to recover from any potential error in our script.
|
||||
|
||||
### How to upgrade from 4.0-beta.x
|
||||
|
||||
Some further changes have been done between the different beta iterations. Transitions made during this period are configured in the `migrate-imports` script. Consequently, you can upgrade from any previous 4.0-beta.x version using the same script as described in the _How to upgrade from 3.x_ section.
|
||||
|
||||
## 3.4.2 (2021-07-24)
|
||||
|
||||
- `TimelockController`: Add additional isOperationReady check.
|
||||
|
||||
## 3.4.1 (2021-03-03)
|
||||
|
||||
- `ERC721`: made `_approve` an internal function (was private).
|
||||
|
||||
## 3.4.0 (2021-02-02)
|
||||
|
||||
- `BeaconProxy`: added new kind of proxy that allows simultaneous atomic upgrades. ([#2411](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2411))
|
||||
- `EIP712`: added helpers to verify EIP712 typed data signatures on chain. ([#2418](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2418))
|
||||
- `ERC20Permit`: added an implementation of the ERC20 permit extension for gasless token approvals. ([#2237](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2237))
|
||||
- Presets: added token presets with preminted fixed supply `ERC20PresetFixedSupply` and `ERC777PresetFixedSupply`. ([#2399](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2399))
|
||||
- `Address`: added `functionDelegateCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
|
||||
- `Clones`: added a library for deploying EIP 1167 minimal proxies. ([#2449](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2449))
|
||||
- `Context`: moved from `contracts/GSN` to `contracts/utils`. ([#2453](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2453))
|
||||
- `PaymentSplitter`: replace usage of `.transfer()` with `Address.sendValue` for improved compatibility with smart wallets. ([#2455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2455))
|
||||
- `UpgradeableProxy`: bubble revert reasons from initialization calls. ([#2454](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2454))
|
||||
- `SafeMath`: fix a memory allocation issue by adding new `SafeMath.tryOp(uint,uint)→(bool,uint)` functions. `SafeMath.op(uint,uint,string)→uint` are now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
|
||||
- `EnumerableMap`: fix a memory allocation issue by adding new `EnumerableMap.tryGet(uint)→(bool,address)` functions. `EnumerableMap.get(uint)→string` is now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
|
||||
- `ERC165Checker`: added batch `getSupportedInterfaces`. ([#2469](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2469))
|
||||
- `RefundEscrow`: `beneficiaryWithdraw` will forward all available gas to the beneficiary. ([#2480](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2480))
|
||||
- Many view and pure functions have been made virtual to customize them via overrides. In many cases this will not imply that other functions in the contract will automatically adapt to the overridden definitions. People who wish to override should consult the source code to understand the impact and if they need to override any additional functions to achieve the desired behavior.
|
||||
|
||||
### Security Fixes
|
||||
|
||||
- `ERC777`: fix potential reentrancy issues for custom extensions to `ERC777`. ([#2483](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2483))
|
||||
|
||||
If you're using our implementation of ERC777 from version 3.3.0 or earlier, and you define a custom `_beforeTokenTransfer` function that writes to a storage variable, you may be vulnerable to a reentrancy attack. If you're affected and would like assistance please write to security@openzeppelin.com. [Read more in the pull request.](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2483)
|
||||
|
||||
## 3.3.0 (2020-11-26)
|
||||
|
||||
- Now supports both Solidity 0.6 and 0.7. Compiling with solc 0.7 will result in warnings. Install the `solc-0.7` tag to compile without warnings.
|
||||
- `Address`: added `functionStaticCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
|
||||
- `TimelockController`: added a contract to augment access control schemes with a delay. ([#2354](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2354))
|
||||
- `EnumerableSet`: added `Bytes32Set`, for sets of `bytes32`. ([#2395](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2395))
|
||||
|
||||
## 3.2.2-solc-0.7 (2020-10-28)
|
||||
|
||||
- Resolve warnings introduced by Solidity 0.7.4. ([#2396](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2396))
|
||||
|
||||
## 3.2.1-solc-0.7 (2020-09-15)
|
||||
|
||||
- `ERC777`: Remove a warning about function state visibility in Solidity 0.7. ([#2327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2327))
|
||||
|
||||
## 3.2.0 (2020-09-10)
|
||||
|
||||
### New features
|
||||
|
||||
- Proxies: added the proxy contracts from OpenZeppelin SDK. ([#2335](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2335))
|
||||
|
||||
#### Proxy changes with respect to OpenZeppelin SDK
|
||||
|
||||
Aside from upgrading them from Solidity 0.5 to 0.6, we've changed a few minor things from the proxy contracts as they were found in OpenZeppelin SDK.
|
||||
|
||||
- `UpgradeabilityProxy` was renamed to `UpgradeableProxy`.
|
||||
- `AdminUpgradeabilityProxy` was renamed to `TransparentUpgradeableProxy`.
|
||||
- `Proxy._willFallback` was renamed to `Proxy._beforeFallback`.
|
||||
- `UpgradeabilityProxy._setImplementation` and `AdminUpgradeabilityProxy._setAdmin` were made private.
|
||||
|
||||
### Improvements
|
||||
|
||||
- `Address.isContract`: switched from `extcodehash` to `extcodesize` for less gas usage. ([#2311](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2311))
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- `ERC20Snapshot`: switched to using `_beforeTokenTransfer` hook instead of overriding ERC20 operations. ([#2312](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2312))
|
||||
|
||||
This small change in the way we implemented `ERC20Snapshot` may affect users who are combining this contract with
|
||||
other ERC20 flavors, since it no longer overrides `_transfer`, `_mint`, and `_burn`. This can result in having to remove Solidity `override(...)` specifiers in derived contracts for these functions, and to instead have to add it for `_beforeTokenTransfer`. See [Using Hooks](https://docs.openzeppelin.com/contracts/3.x/extending-contracts#using-hooks) in the documentation.
|
||||
|
||||
## 3.1.0 (2020-06-23)
|
||||
|
||||
### New features
|
||||
|
||||
- `SafeCast`: added functions to downcast signed integers (e.g. `toInt32`), improving usability of `SignedSafeMath`. ([#2243](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2243))
|
||||
- `functionCall`: new helpers that replicate Solidity's function call semantics, reducing the need to rely on `call`. ([#2264](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2264))
|
||||
- `ERC1155`: added support for a base implementation, non-standard extensions and a preset contract. ([#2014](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2014), [#2230](https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2230))
|
||||
|
||||
### Improvements
|
||||
|
||||
- `ReentrancyGuard`: reduced overhead of using the `nonReentrant` modifier. ([#2171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2171))
|
||||
- `AccessControl`: added a `RoleAdminChanged` event to `_setAdminRole`. ([#2214](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2214))
|
||||
- Made all `public` functions in the token preset contracts `virtual`. ([#2257](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2257))
|
||||
|
||||
### Deprecations
|
||||
|
||||
- `SafeERC20`: deprecated `safeApprove`. ([#2268](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2268))
|
||||
|
||||
## 3.0.2 (2020-06-08)
|
||||
|
||||
### Improvements
|
||||
|
||||
- Added SPX license identifier to all contracts. ([#2235](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2235))
|
||||
|
||||
## 3.0.1 (2020-04-27)
|
||||
|
||||
### Bugfixes
|
||||
* `ERC777`: fixed the `_approve` internal function not validating some of their arguments for non-zero addresses. ([#2213](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2213))
|
||||
|
||||
- `ERC777`: fixed the `_approve` internal function not validating some of their arguments for non-zero addresses. ([#2213](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2213))
|
||||
|
||||
## 3.0.0 (2020-04-20)
|
||||
|
||||
### New features
|
||||
* `AccessControl`: new contract for managing permissions in a system, replacement for `Ownable` and `Roles`. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
|
||||
* `SafeCast`: new functions to convert to and from signed and unsigned values: `toUint256` and `toInt256`. ([#2123](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2123))
|
||||
* `EnumerableMap`: a new data structure for key-value pairs (like `mapping`) that can be iterated over. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
|
||||
|
||||
- `AccessControl`: new contract for managing permissions in a system, replacement for `Ownable` and `Roles`. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
|
||||
- `SafeCast`: new functions to convert to and from signed and unsigned values: `toUint256` and `toInt256`. ([#2123](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2123))
|
||||
- `EnumerableMap`: a new data structure for key-value pairs (like `mapping`) that can be iterated over. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
|
||||
|
||||
### Breaking changes
|
||||
* `ERC721`: `burn(owner, tokenId)` was removed, use `burn(tokenId)` instead. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
|
||||
* `ERC721`: `_checkOnERC721Received` was removed. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
|
||||
* `ERC721`: `_transferFrom` and `_safeTransferFrom` were renamed to `_transfer` and `_safeTransfer`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
|
||||
* `Ownable`: removed `_transferOwnership`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
|
||||
* `PullPayment`, `Escrow`: `withdrawWithGas` was removed. The old `withdraw` function now forwards all gas. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
|
||||
* `Roles` was removed, use `AccessControl` as a replacement. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
|
||||
* `ECDSA`: when receiving an invalid signature, `recover` now reverts instead of returning the zero address. ([#2114](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2114))
|
||||
* `Create2`: added an `amount` argument to `deploy` for contracts with `payable` constructors. ([#2117](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2117))
|
||||
* `Pausable`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
* `Strings`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
* `Counters`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
* `SignedSafeMath`: moved to the `math` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
* `ERC20Snapshot`: moved to the `token/ERC20` directory. `snapshot` was changed into an `internal` function. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
* `Ownable`: moved to the `access` directory. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
* `Ownable`: removed `isOwner`. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
* `Secondary`: removed from the library, use `Ownable` instead. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
* `Escrow`, `ConditionalEscrow`, `RefundEscrow`: these now use `Ownable` instead of `Secondary`, their external API changed accordingly. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
* `ERC20`: removed `_burnFrom`. ([#2119](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2119))
|
||||
* `Address`: removed `toPayable`, use `payable(address)` instead. ([#2133](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2133))
|
||||
* `ERC777`: `_send`, `_mint` and `_burn` now use the caller as the operator. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
|
||||
* `ERC777`: removed `_callsTokensToSend` and `_callTokensReceived`. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
|
||||
* `EnumerableSet`: renamed `get` to `at`. ([#2151](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2151))
|
||||
* `ERC165Checker`: functions no longer have a leading underscore. ([#2150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2150))
|
||||
* `ERC721Metadata`, `ERC721Enumerable`: these contracts were removed, and their functionality merged into `ERC721`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
|
||||
* `ERC721`: added a constructor for `name` and `symbol`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
|
||||
* `ERC20Detailed`: this contract was removed and its functionality merged into `ERC20`. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
|
||||
* `ERC20`: added a constructor for `name` and `symbol`. `decimals` now defaults to 18. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
|
||||
* `Strings`: renamed `fromUint256` to `toString` ([#2188](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2188))
|
||||
|
||||
- `ERC721`: `burn(owner, tokenId)` was removed, use `burn(tokenId)` instead. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
|
||||
- `ERC721`: `_checkOnERC721Received` was removed. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
|
||||
- `ERC721`: `_transferFrom` and `_safeTransferFrom` were renamed to `_transfer` and `_safeTransfer`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
|
||||
- `Ownable`: removed `_transferOwnership`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
|
||||
- `PullPayment`, `Escrow`: `withdrawWithGas` was removed. The old `withdraw` function now forwards all gas. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
|
||||
- `Roles` was removed, use `AccessControl` as a replacement. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
|
||||
- `ECDSA`: when receiving an invalid signature, `recover` now reverts instead of returning the zero address. ([#2114](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2114))
|
||||
- `Create2`: added an `amount` argument to `deploy` for contracts with `payable` constructors. ([#2117](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2117))
|
||||
- `Pausable`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
- `Strings`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
- `Counters`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
- `SignedSafeMath`: moved to the `math` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
- `ERC20Snapshot`: moved to the `token/ERC20` directory. `snapshot` was changed into an `internal` function. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
|
||||
- `Ownable`: moved to the `access` directory. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
- `Ownable`: removed `isOwner`. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
- `Secondary`: removed from the library, use `Ownable` instead. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
- `Escrow`, `ConditionalEscrow`, `RefundEscrow`: these now use `Ownable` instead of `Secondary`, their external API changed accordingly. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
|
||||
- `ERC20`: removed `_burnFrom`. ([#2119](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2119))
|
||||
- `Address`: removed `toPayable`, use `payable(address)` instead. ([#2133](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2133))
|
||||
- `ERC777`: `_send`, `_mint` and `_burn` now use the caller as the operator. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
|
||||
- `ERC777`: removed `_callsTokensToSend` and `_callTokensReceived`. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
|
||||
- `EnumerableSet`: renamed `get` to `at`. ([#2151](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2151))
|
||||
- `ERC165Checker`: functions no longer have a leading underscore. ([#2150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2150))
|
||||
- `ERC721Metadata`, `ERC721Enumerable`: these contracts were removed, and their functionality merged into `ERC721`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
|
||||
- `ERC721`: added a constructor for `name` and `symbol`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
|
||||
- `ERC20Detailed`: this contract was removed and its functionality merged into `ERC20`. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
|
||||
- `ERC20`: added a constructor for `name` and `symbol`. `decimals` now defaults to 18. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
|
||||
- `Strings`: renamed `fromUint256` to `toString` ([#2188](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2188))
|
||||
|
||||
## 2.5.1 (2020-04-24)
|
||||
|
||||
### Bugfixes
|
||||
* `ERC777`: fixed the `_send` and `_approve` internal functions not validating some of their arguments for non-zero addresses. ([#2212](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2212))
|
||||
|
||||
- `ERC777`: fixed the `_send` and `_approve` internal functions not validating some of their arguments for non-zero addresses. ([#2212](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2212))
|
||||
|
||||
## 2.5.0 (2020-02-04)
|
||||
|
||||
### New features
|
||||
* `SafeCast.toUintXX`: new library for integer downcasting, which allows for safe operation on smaller types (e.g. `uint32`) when combined with `SafeMath`. ([#1926](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1926))
|
||||
* `ERC721Metadata`: added `baseURI`, which can be used for dramatic gas savings when all token URIs share a prefix (e.g. `http://api.myapp.com/tokens/<id>`). ([#1970](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1970))
|
||||
* `EnumerableSet`: new library for storing enumerable sets of values. Only `AddressSet` is supported in this release. ([#2061](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/2061))
|
||||
* `Create2`: simple library to make usage of the `CREATE2` opcode easier. ([#1744](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1744))
|
||||
|
||||
- `SafeCast.toUintXX`: new library for integer downcasting, which allows for safe operation on smaller types (e.g. `uint32`) when combined with `SafeMath`. ([#1926](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1926))
|
||||
- `ERC721Metadata`: added `baseURI`, which can be used for dramatic gas savings when all token URIs share a prefix (e.g. `http://api.myapp.com/tokens/<id>`). ([#1970](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1970))
|
||||
- `EnumerableSet`: new library for storing enumerable sets of values. Only `AddressSet` is supported in this release. ([#2061](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/2061))
|
||||
- `Create2`: simple library to make usage of the `CREATE2` opcode easier. ([#1744](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1744))
|
||||
|
||||
### Improvements
|
||||
* `ERC777`: `_burn` is now internal, providing more flexibility and making it easier to create tokens that deflate. ([#1908](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1908))
|
||||
* `ReentrancyGuard`: greatly improved gas efficiency by using the net gas metering mechanism introduced in the Istanbul hardfork. ([#1992](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1992), [#1996](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1996))
|
||||
* `ERC777`: improve extensibility by making `_send` and related functions `internal`. ([#2027](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2027))
|
||||
* `ERC721`: improved revert reason when transferring tokens to a non-recipient contract. ([#2018](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2018))
|
||||
|
||||
- `ERC777`: `_burn` is now internal, providing more flexibility and making it easier to create tokens that deflate. ([#1908](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1908))
|
||||
- `ReentrancyGuard`: greatly improved gas efficiency by using the net gas metering mechanism introduced in the Istanbul hardfork. ([#1992](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1992), [#1996](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1996))
|
||||
- `ERC777`: improve extensibility by making `_send` and related functions `internal`. ([#2027](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2027))
|
||||
- `ERC721`: improved revert reason when transferring tokens to a non-recipient contract. ([#2018](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2018))
|
||||
|
||||
### Breaking changes
|
||||
* `ERC165Checker` now requires a minimum Solidity compiler version of 0.5.10. ([#1829](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1829))
|
||||
|
||||
- `ERC165Checker` now requires a minimum Solidity compiler version of 0.5.10. ([#1829](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1829))
|
||||
|
||||
## 2.4.0 (2019-10-29)
|
||||
|
||||
### New features
|
||||
* `Address.toPayable`: added a helper to convert between address types without having to resort to low-level casting. ([#1773](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1773))
|
||||
* Facilities to make metatransaction-enabled contracts through the Gas Station Network. ([#1844](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1844))
|
||||
* `Address.sendValue`: added a replacement to Solidity's `transfer`, removing the fixed gas stipend. ([#1962](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1962))
|
||||
* Added replacement for functions that don't forward all gas (which have been deprecated): ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
|
||||
* `PullPayment.withdrawPaymentsWithGas(address payable payee)`
|
||||
* `Escrow.withdrawWithGas(address payable payee)`
|
||||
* `SafeMath`: added support for custom error messages to `sub`, `div` and `mod` functions. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
|
||||
|
||||
- `Address.toPayable`: added a helper to convert between address types without having to resort to low-level casting. ([#1773](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1773))
|
||||
- Facilities to make metatransaction-enabled contracts through the Gas Station Network. ([#1844](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1844))
|
||||
- `Address.sendValue`: added a replacement to Solidity's `transfer`, removing the fixed gas stipend. ([#1962](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1962))
|
||||
- Added replacement for functions that don't forward all gas (which have been deprecated): ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
|
||||
- `PullPayment.withdrawPaymentsWithGas(address payable payee)`
|
||||
- `Escrow.withdrawWithGas(address payable payee)`
|
||||
- `SafeMath`: added support for custom error messages to `sub`, `div` and `mod` functions. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
|
||||
|
||||
### Improvements
|
||||
* `Address.isContract`: switched from `extcodesize` to `extcodehash` for less gas usage. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
|
||||
* `ERC20` and `ERC777` updated to throw custom errors on subtraction overflows. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
|
||||
|
||||
- `Address.isContract`: switched from `extcodesize` to `extcodehash` for less gas usage. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
|
||||
- `ERC20` and `ERC777` updated to throw custom errors on subtraction overflows. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
|
||||
|
||||
### Deprecations
|
||||
* Deprecated functions that don't forward all gas: ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
|
||||
* `PullPayment.withdrawPayments(address payable payee)`
|
||||
* `Escrow.withdraw(address payable payee)`
|
||||
|
||||
- Deprecated functions that don't forward all gas: ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
|
||||
- `PullPayment.withdrawPayments(address payable payee)`
|
||||
- `Escrow.withdraw(address payable payee)`
|
||||
|
||||
### Breaking changes
|
||||
* `Address` now requires a minimum Solidity compiler version of 0.5.5. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
|
||||
* `SignatureBouncer` has been removed from drafts, both to avoid confusions with the GSN and `GSNRecipientSignature` (previously called `GSNBouncerSignature`) and because the API was not very clear. ([#1879](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1879))
|
||||
|
||||
- `Address` now requires a minimum Solidity compiler version of 0.5.5. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
|
||||
- `SignatureBouncer` has been removed from drafts, both to avoid confusions with the GSN and `GSNRecipientSignature` (previously called `GSNBouncerSignature`) and because the API was not very clear. ([#1879](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1879))
|
||||
|
||||
### How to upgrade from 2.4.0-beta
|
||||
|
||||
The final 2.4.0 release includes a refactor of the GSN contracts that will be a breaking change for 2.4.0-beta users.
|
||||
|
||||
* The default empty implementations of `_preRelayedCall` and `_postRelayedCall` were removed and must now be explicitly implemented always in custom recipients. If your custom recipient didn't include an implementation, you can provide an empty one.
|
||||
* `GSNRecipient`, `GSNBouncerBase`, and `GSNContext` were all merged into `GSNRecipient`.
|
||||
* `GSNBouncerSignature` and `GSNBouncerERC20Fee` were renamed to `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
|
||||
* It is no longer necessary to inherit from `GSNRecipient` when using `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
|
||||
- The default empty implementations of `_preRelayedCall` and `_postRelayedCall` were removed and must now be explicitly implemented always in custom recipients. If your custom recipient didn't include an implementation, you can provide an empty one.
|
||||
- `GSNRecipient`, `GSNBouncerBase`, and `GSNContext` were all merged into `GSNRecipient`.
|
||||
- `GSNBouncerSignature` and `GSNBouncerERC20Fee` were renamed to `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
|
||||
- It is no longer necessary to inherit from `GSNRecipient` when using `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
|
||||
|
||||
For example, a contract using `GSNBouncerSignature` would have to be changed in the following way.
|
||||
|
||||
@ -106,81 +572,94 @@ For example, a contract using `GSNBouncerSignature` would have to be changed in
|
||||
|
||||
Refer to the table below to adjust your inheritance list.
|
||||
|
||||
| 2.4.0-beta | 2.4.0 |
|
||||
| ---------------------------------- | ---------------------------- |
|
||||
| `GSNRecipient, GSNBouncerSignature`| `GSNRecipientSignature` |
|
||||
| `GSNRecipient, GSNBouncerERC20Fee` | `GSNRecipientERC20Fee` |
|
||||
| `GSNBouncerBase` | `GSNRecipient` |
|
||||
| 2.4.0-beta | 2.4.0 |
|
||||
| ----------------------------------- | ----------------------- |
|
||||
| `GSNRecipient, GSNBouncerSignature` | `GSNRecipientSignature` |
|
||||
| `GSNRecipient, GSNBouncerERC20Fee` | `GSNRecipientERC20Fee` |
|
||||
| `GSNBouncerBase` | `GSNRecipient` |
|
||||
|
||||
## 2.3.0 (2019-05-27)
|
||||
|
||||
### New features
|
||||
* `ERC1820`: added support for interacting with the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) registry contract (`IERC1820Registry`), as well as base contracts that can be registered as implementers there. ([#1677](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1677))
|
||||
* `ERC777`: support for the [ERC777 token](https://eips.ethereum.org/EIPS/eip-777), which has multiple improvements over `ERC20` (but is backwards compatible with it) such as built-in burning, a more straightforward permission system, and optional sender and receiver hooks on transfer (mandatory for contracts!). ([#1684](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1684))
|
||||
* All contracts now have revert reason strings, which give insight into error conditions, and help debug failing transactions. ([#1704](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1704))
|
||||
|
||||
- `ERC1820`: added support for interacting with the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) registry contract (`IERC1820Registry`), as well as base contracts that can be registered as implementers there. ([#1677](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1677))
|
||||
- `ERC777`: support for the [ERC777 token](https://eips.ethereum.org/EIPS/eip-777), which has multiple improvements over `ERC20` (but is backwards compatible with it) such as built-in burning, a more straightforward permission system, and optional sender and receiver hooks on transfer (mandatory for contracts!). ([#1684](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1684))
|
||||
- All contracts now have revert reason strings, which give insight into error conditions, and help debug failing transactions. ([#1704](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1704))
|
||||
|
||||
### Improvements
|
||||
* Reverted the Solidity version bump done in v2.2.0, setting the minimum compiler version to v0.5.0, to prevent unexpected build breakage. Users are encouraged however to stay on top of new compiler releases, which usually include bugfixes. ([#1729](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1729))
|
||||
|
||||
- Reverted the Solidity version bump done in v2.2.0, setting the minimum compiler version to v0.5.0, to prevent unexpected build breakage. Users are encouraged however to stay on top of new compiler releases, which usually include bugfixes. ([#1729](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1729))
|
||||
|
||||
### Bugfixes
|
||||
* `PostDeliveryCrowdsale`: some validations where skipped when paired with other crowdsale flavors, such as `AllowanceCrowdsale`, or `MintableCrowdsale` and `ERC20Capped`, which could cause buyers to not be able to claim their purchased tokens. ([#1721](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1721))
|
||||
* `ERC20._transfer`: the `from` argument was allowed to be the zero address, so it was possible to internally trigger a transfer of 0 tokens from the zero address. This address is not a valid destinatary of transfers, nor can it give or receive allowance, so this behavior was inconsistent. It now reverts. ([#1752](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1752))
|
||||
|
||||
- `PostDeliveryCrowdsale`: some validations where skipped when paired with other crowdsale flavors, such as `AllowanceCrowdsale`, or `MintableCrowdsale` and `ERC20Capped`, which could cause buyers to not be able to claim their purchased tokens. ([#1721](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1721))
|
||||
- `ERC20._transfer`: the `from` argument was allowed to be the zero address, so it was possible to internally trigger a transfer of 0 tokens from the zero address. This address is not a valid destinatary of transfers, nor can it give or receive allowance, so this behavior was inconsistent. It now reverts. ([#1752](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1752))
|
||||
|
||||
## 2.2.0 (2019-03-14)
|
||||
|
||||
### New features
|
||||
* `ERC20Snapshot`: create snapshots on demand of the token balances and total supply, to later retrieve and e.g. calculate dividends at a past time. ([#1617](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1617))
|
||||
* `SafeERC20`: `ERC20` contracts with no return value (i.e. that revert on failure) are now supported. ([#1655](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1655))
|
||||
* `ERC20`: added internal `_approve(address owner, address spender, uint256 value)`, allowing derived contracts to set the allowance of arbitrary accounts. ([#1609](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1609))
|
||||
* `ERC20Metadata`: added internal `_setTokenURI(string memory tokenURI)`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
|
||||
* `TimedCrowdsale`: added internal `_extendTime(uint256 newClosingTime)` as well as `TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime)` event allowing to extend the crowdsale, as long as it hasn't already closed.
|
||||
|
||||
- `ERC20Snapshot`: create snapshots on demand of the token balances and total supply, to later retrieve and e.g. calculate dividends at a past time. ([#1617](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1617))
|
||||
- `SafeERC20`: `ERC20` contracts with no return value (i.e. that revert on failure) are now supported. ([#1655](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1655))
|
||||
- `ERC20`: added internal `_approve(address owner, address spender, uint256 value)`, allowing derived contracts to set the allowance of arbitrary accounts. ([#1609](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1609))
|
||||
- `ERC20Metadata`: added internal `_setTokenURI(string memory tokenURI)`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
|
||||
- `TimedCrowdsale`: added internal `_extendTime(uint256 newClosingTime)` as well as `TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime)` event allowing to extend the crowdsale, as long as it hasn't already closed.
|
||||
|
||||
### Improvements
|
||||
* Upgraded the minimum compiler version to v0.5.2: this removes many Solidity warnings that were false positives. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
|
||||
* `ECDSA`: `recover` no longer accepts malleable signatures (those using upper-range values for `s`, or 0/1 for `v`). ([#1622](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1622))
|
||||
* ``ERC721``'s transfers are now more gas efficient due to removal of unnecessary `SafeMath` calls. ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
|
||||
* Fixed variable shadowing issues. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
|
||||
|
||||
- Upgraded the minimum compiler version to v0.5.2: this removes many Solidity warnings that were false positives. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
|
||||
- `ECDSA`: `recover` no longer accepts malleable signatures (those using upper-range values for `s`, or 0/1 for `v`). ([#1622](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1622))
|
||||
- `ERC721`'s transfers are now more gas efficient due to removal of unnecessary `SafeMath` calls. ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
|
||||
- Fixed variable shadowing issues. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
|
||||
|
||||
### Bugfixes
|
||||
* (minor) `SafeERC20`: `safeApprove` wasn't properly checking for a zero allowance when attempting to set a non-zero allowance. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
|
||||
|
||||
- (minor) `SafeERC20`: `safeApprove` wasn't properly checking for a zero allowance when attempting to set a non-zero allowance. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
|
||||
|
||||
### Breaking changes in drafts
|
||||
* `TokenMetadata` has been renamed to `ERC20Metadata`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
|
||||
* The library `Counter` has been renamed to `Counters` and its API has been improved. See an example in `ERC721`, lines [17](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L17) and [204](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L204). ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
|
||||
|
||||
- `TokenMetadata` has been renamed to `ERC20Metadata`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
|
||||
- The library `Counter` has been renamed to `Counters` and its API has been improved. See an example in `ERC721`, lines [17](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L17) and [204](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L204). ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
|
||||
|
||||
## 2.1.3 (2019-02-26)
|
||||
* Backported `SafeERC20.safeApprove` bugfix. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
|
||||
|
||||
- Backported `SafeERC20.safeApprove` bugfix. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
|
||||
|
||||
## 2.1.2 (2019-01-17)
|
||||
* Removed most of the test suite from the npm package, except `PublicRole.behavior.js`, which may be useful to users testing their own `Roles`.
|
||||
|
||||
- Removed most of the test suite from the npm package, except `PublicRole.behavior.js`, which may be useful to users testing their own `Roles`.
|
||||
|
||||
## 2.1.1 (2019-01-04)
|
||||
* Version bump to avoid conflict in the npm registry.
|
||||
|
||||
- Version bump to avoid conflict in the npm registry.
|
||||
|
||||
## 2.1.0 (2019-01-04)
|
||||
|
||||
### New features
|
||||
* Now targeting the 0.5.x line of Solidity compilers. For 0.4.24 support, use version 2.0 of OpenZeppelin.
|
||||
* `WhitelistCrowdsale`: a crowdsale where only whitelisted accounts (`WhitelistedRole`) can purchase tokens. Adding or removing accounts from the whitelist is done by whitelist admins (`WhitelistAdminRole`). Similar to the pre-2.0 `WhitelistedCrowdsale`. ([#1525](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1525), [#1589](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1589))
|
||||
* `RefundablePostDeliveryCrowdsale`: replacement for `RefundableCrowdsale` (deprecated, see below) where tokens are only granted once the crowdsale ends (if it meets its goal). ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
|
||||
* `PausableCrowdsale`: allows for pausers (`PauserRole`) to pause token purchases. Other crowdsale operations (e.g. withdrawals and refunds, if applicable) are not affected. ([#832](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/832))
|
||||
* `ERC20`: `transferFrom` and `_burnFrom ` now emit `Approval` events, to represent the token's state comprehensively through events. ([#1524](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1524))
|
||||
* `ERC721`: added `_burn(uint256 tokenId)`, replacing the similar deprecated function (see below). ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
|
||||
* `ERC721`: added `_tokensOfOwner(address owner)`, allowing to internally retrieve the array of an account's owned tokens. ([#1522](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1522))
|
||||
* Crowdsales: all constructors are now `public`, meaning it is not necessary to extend these contracts in order to deploy them. The exception is `FinalizableCrowdsale`, since it is meaningless unless extended. ([#1564](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1564))
|
||||
* `SignedSafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559), [#1588](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1588))
|
||||
|
||||
- Now targeting the 0.5.x line of Solidity compilers. For 0.4.24 support, use version 2.0 of OpenZeppelin.
|
||||
- `WhitelistCrowdsale`: a crowdsale where only whitelisted accounts (`WhitelistedRole`) can purchase tokens. Adding or removing accounts from the whitelist is done by whitelist admins (`WhitelistAdminRole`). Similar to the pre-2.0 `WhitelistedCrowdsale`. ([#1525](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1525), [#1589](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1589))
|
||||
- `RefundablePostDeliveryCrowdsale`: replacement for `RefundableCrowdsale` (deprecated, see below) where tokens are only granted once the crowdsale ends (if it meets its goal). ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
|
||||
- `PausableCrowdsale`: allows for pausers (`PauserRole`) to pause token purchases. Other crowdsale operations (e.g. withdrawals and refunds, if applicable) are not affected. ([#832](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/832))
|
||||
- `ERC20`: `transferFrom` and `_burnFrom ` now emit `Approval` events, to represent the token's state comprehensively through events. ([#1524](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1524))
|
||||
- `ERC721`: added `_burn(uint256 tokenId)`, replacing the similar deprecated function (see below). ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
|
||||
- `ERC721`: added `_tokensOfOwner(address owner)`, allowing to internally retrieve the array of an account's owned tokens. ([#1522](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1522))
|
||||
- Crowdsales: all constructors are now `public`, meaning it is not necessary to extend these contracts in order to deploy them. The exception is `FinalizableCrowdsale`, since it is meaningless unless extended. ([#1564](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1564))
|
||||
- `SignedSafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559), [#1588](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1588))
|
||||
|
||||
### Improvements
|
||||
* The compiler version required by `Array` was behind the rest of the libray so it was updated to `v0.4.24`. ([#1553](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1553))
|
||||
* Now conforming to a 4-space indentation code style. ([1508](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1508))
|
||||
* `ERC20`: more gas efficient due to removed redundant `require`s. ([#1409](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1409))
|
||||
* `ERC721`: fixed a bug that prevented internal data structures from being properly cleaned, missing potential gas refunds. ([#1539](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1539) and [#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
|
||||
* `ERC721`: general gas savings on `transferFrom`, `_mint` and `_burn`, due to redudant `require`s and `SSTORE`s. ([#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
|
||||
|
||||
- The compiler version required by `Array` was behind the rest of the library so it was updated to `v0.4.24`. ([#1553](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1553))
|
||||
- Now conforming to a 4-space indentation code style. ([1508](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1508))
|
||||
- `ERC20`: more gas efficient due to removed redundant `require`s. ([#1409](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1409))
|
||||
- `ERC721`: fixed a bug that prevented internal data structures from being properly cleaned, missing potential gas refunds. ([#1539](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1539) and [#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
|
||||
- `ERC721`: general gas savings on `transferFrom`, `_mint` and `_burn`, due to redundant `require`s and `SSTORE`s. ([#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
|
||||
|
||||
### Bugfixes
|
||||
|
||||
### Breaking changes
|
||||
|
||||
### Deprecations
|
||||
* `ERC721._burn(address owner, uint256 tokenId)`: due to the `owner` parameter being unnecessary. ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
|
||||
* `RefundableCrowdsale`: due to trading abuse potential on crowdsales that miss their goal. ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
|
||||
|
||||
- `ERC721._burn(address owner, uint256 tokenId)`: due to the `owner` parameter being unnecessary. ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
|
||||
- `RefundableCrowdsale`: due to trading abuse potential on crowdsales that miss their goal. ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
|
||||
|
||||
@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at maintainers@openzeppelin.org. All
|
||||
reported by contacting the project team at contact@openzeppelin.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
# Code Style
|
||||
|
||||
We value clean code and consistency, and those are prerequisites for us to
|
||||
include new code in the repository. Before proposing a change, please read this
|
||||
document and take some time to familiarize yourself with the style of the
|
||||
existing codebase.
|
||||
|
||||
## Solidity code
|
||||
|
||||
In order to be consistent with all the other Solidity projects, we follow the
|
||||
[official recommendations documented in the Solidity style guide](http://solidity.readthedocs.io/en/latest/style-guide.html).
|
||||
|
||||
Any exception or additions specific to our project are documented below.
|
||||
|
||||
### Naming
|
||||
|
||||
* Try to avoid acronyms and abbreviations.
|
||||
|
||||
* All state variables should be private.
|
||||
|
||||
* Private state variables should have an underscore prefix.
|
||||
|
||||
```
|
||||
contract TestContract {
|
||||
uint256 private _privateVar;
|
||||
uint256 internal _internalVar;
|
||||
}
|
||||
```
|
||||
|
||||
* Parameters must not be prefixed with an underscore.
|
||||
|
||||
```
|
||||
function test(uint256 testParameter1, uint256 testParameter2) {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
* Internal and private functions should have an underscore prefix.
|
||||
|
||||
```
|
||||
function _testInternal() internal {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
function _testPrivate() private {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
* Events should be emitted immediately after the state change that they
|
||||
represent, and consequently they should be named in past tense.
|
||||
|
||||
```
|
||||
function _burn(address _who, uint256 _value) internal {
|
||||
super._burn(_who, _value);
|
||||
emit TokensBurned(_who, _value);
|
||||
}
|
||||
```
|
||||
|
||||
Some standards (e.g. ERC20) use present tense, and in those cases the
|
||||
standard specification prevails.
|
||||
|
||||
* Interface names should have a capital I prefix.
|
||||
|
||||
```
|
||||
interface IERC777 {
|
||||
```
|
||||
@ -1,71 +1,36 @@
|
||||
Contributing to OpenZeppelin Contracts
|
||||
=======
|
||||
# Contributing Guidelines
|
||||
|
||||
We really appreciate and value contributions to OpenZeppelin Contracts. Please take 5' to review the items listed below to make sure that your contributions are merged as soon as possible.
|
||||
There are many ways to contribute to OpenZeppelin Contracts.
|
||||
|
||||
## Contribution guidelines
|
||||
## Troubleshooting
|
||||
|
||||
Smart contracts manage value and are highly vulnerable to errors and attacks. We have very strict [guidelines], please make sure to review them!
|
||||
You can help other users in the community to solve their smart contract issues in the [OpenZeppelin Forum].
|
||||
|
||||
## Creating Pull Requests (PRs)
|
||||
[OpenZeppelin Forum]: https://forum.openzeppelin.com/
|
||||
|
||||
As a contributor, you are expected to fork this repository, work on your own fork and then submit pull requests. The pull requests will be reviewed and eventually merged into the main repo. See ["Fork-a-Repo"](https://help.github.com/articles/fork-a-repo/) for how this works.
|
||||
## Opening an issue
|
||||
|
||||
## A typical workflow
|
||||
You can [open an issue] to suggest a feature or report a minor bug. For serious bugs please do not open an issue, instead refer to our [security policy] for appropriate steps.
|
||||
|
||||
1) Make sure your fork is up to date with the main repository:
|
||||
If you believe your issue may be due to user error and not a problem in the library, consider instead posting a question on the [OpenZeppelin Forum].
|
||||
|
||||
```
|
||||
cd openzeppelin-contracts
|
||||
git remote add upstream https://github.com/OpenZeppelin/openzeppelin-contracts.git
|
||||
git fetch upstream
|
||||
git pull --rebase upstream master
|
||||
```
|
||||
NOTE: The directory `openzeppelin-contracts` represents your fork's local copy.
|
||||
Before opening an issue, be sure to search through the existing open and closed issues, and consider posting a comment in one of those instead.
|
||||
|
||||
2) Branch out from `master` into `fix/some-bug-#123`:
|
||||
(Postfixing #123 will associate your PR with the issue #123 and make everyone's life easier =D)
|
||||
```
|
||||
git checkout -b fix/some-bug-#123
|
||||
```
|
||||
When requesting a new feature, include as many details as you can, especially around the use cases that motivate it. Features are prioritized according to the impact they may have on the ecosystem, so we appreciate information showing that the impact could be high.
|
||||
|
||||
3) Make your changes, add your files, commit, and push to your fork.
|
||||
[security policy]: https://github.com/OpenZeppelin/openzeppelin-contracts/security
|
||||
[open an issue]: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/new/choose
|
||||
|
||||
```
|
||||
git add SomeFile.js
|
||||
git commit "Fix some bug #123"
|
||||
git push origin fix/some-bug-#123
|
||||
```
|
||||
## Submitting a pull request
|
||||
|
||||
4) Run tests, linter, etc. This can be done by running local continuous integration and make sure it passes.
|
||||
If you would like to contribute code or documentation you may do so by forking the repository and submitting a pull request.
|
||||
|
||||
```bash
|
||||
npm test
|
||||
npm run lint
|
||||
```
|
||||
Any non-trivial code contribution must be first discussed with the maintainers in an issue (see [Opening an issue](#opening-an-issue)). Only very minor changes are accepted without prior discussion.
|
||||
|
||||
or you can simply run CircleCI locally
|
||||
```bash
|
||||
circleci local execute --job build
|
||||
circleci local execute --job test
|
||||
```
|
||||
*Note*: requires installing CircleCI and docker locally on your machine.
|
||||
Make sure to read and follow the [engineering guidelines](./GUIDELINES.md). Run linter and tests to make sure your pull request is good before submitting it.
|
||||
|
||||
5) Go to [github.com/OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) in your web browser and issue a new pull request.
|
||||
Changelog entries should be added to each pull request by using [Changesets](https://github.com/changesets/changesets/).
|
||||
|
||||
*IMPORTANT* Read the PR template very carefully and make sure to follow all the instructions. These instructions
|
||||
refer to some very important conditions that your PR must meet in order to be accepted, such as making sure that all tests pass, JS linting tests pass, Solidity linting tests pass, etc.
|
||||
When opening the pull request you will be presented with a template and a series of instructions. Read through it carefully and follow all the steps. Expect a review and feedback from the maintainers afterwards.
|
||||
|
||||
6) Maintainers will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of OpenZeppelin.
|
||||
|
||||
*IMPORTANT* Please pay attention to the maintainer's feedback, since its a necessary step to keep up with the standards OpenZeppelin attains to.
|
||||
|
||||
## All set!
|
||||
|
||||
If you have any questions, feel free to post them to github.com/OpenZeppelin/openzeppelin-contracts/issues.
|
||||
|
||||
Finally, if you're looking to collaborate and want to find easy tasks to start, look at the issues we marked as ["Good first issue"](https://github.com/OpenZeppelin/openzeppelin-contracts/labels/good%20first%20issue).
|
||||
|
||||
Thanks for your time and code!
|
||||
|
||||
[guidelines]: GUIDELINES.md
|
||||
If you're looking for a good place to start, look for issues labelled ["good first issue"](https://github.com/OpenZeppelin/openzeppelin-contracts/labels/good%20first%20issue)!
|
||||
|
||||
121
GUIDELINES.md
121
GUIDELINES.md
@ -1,64 +1,117 @@
|
||||
Design Guidelines
|
||||
=======
|
||||
# Engineering Guidelines
|
||||
|
||||
These are some global design goals in OpenZeppelin.
|
||||
## Testing
|
||||
|
||||
#### D0 - Security in Depth
|
||||
We strive to provide secure, tested, audited code. To achieve this, we need to match intention with function. Thus, documentation, code clarity, community review and security discussions are fundamental.
|
||||
Code must be thoroughly tested with quality unit tests.
|
||||
|
||||
#### D1 - Simple and Modular
|
||||
Simpler code means easier audits, and better understanding of what each component does. We look for small files, small contracts, and small functions. If you can separate a contract into two independent functionalities you should probably do it.
|
||||
We defer to the [Moloch Testing Guide](https://github.com/MolochVentures/moloch/tree/master/test#readme) for specific recommendations, though not all of it is relevant here. Note the introduction:
|
||||
|
||||
#### D2 - Naming Matters
|
||||
> Tests should be written, not only to verify correctness of the target code, but to be comprehensively reviewed by other programmers. Therefore, for mission critical Solidity code, the quality of the tests are just as important (if not more so) than the code itself, and should be written with the highest standards of clarity and elegance.
|
||||
|
||||
We take our time with picking names. Code is going to be written once, and read hundreds of times. Renaming for clarity is encouraged.
|
||||
Every addition or change to the code must come with relevant and comprehensive tests.
|
||||
|
||||
#### D3 - Tests
|
||||
Refactors should avoid simultaneous changes to tests.
|
||||
|
||||
Write tests for all your code. We encourage Test Driven Development so we know when our code is right. Even though not all code in the repository is tested at the moment, we aim to test every line of code in the future.
|
||||
Flaky tests are not acceptable.
|
||||
|
||||
#### D4 - Check preconditions and post-conditions
|
||||
The test suite should run automatically for every change in the repository, and in pull requests tests must pass before merging.
|
||||
|
||||
A very important way to prevent vulnerabilities is to catch a contract’s inconsistent state as early as possible. This is why we want functions to check pre- and post-conditions for executing its logic. When writing code, ask yourself what you are expecting to be true before and after the function runs, and express it in code.
|
||||
The test suite coverage must be kept as close to 100% as possible, enforced in pull requests.
|
||||
|
||||
#### D5 - Code Consistency
|
||||
In some cases unit tests may be insufficient and complementary techniques should be used:
|
||||
|
||||
Consistency on the way classes are used is paramount to an easier understanding of the library. The codebase should be as unified as possible. Read existing code and get inspired before you write your own. Follow the style guidelines. Don’t hesitate to ask for help on how to best write a specific piece of code.
|
||||
1. Property-based tests (aka. fuzzing) for math-heavy code.
|
||||
2. Formal verification for state machines.
|
||||
|
||||
#### D6 - Regular Audits
|
||||
Following good programming practices is a way to reduce the risk of vulnerabilities, but professional code audits are still needed. We will perform regular code audits on major releases, and hire security professionals to provide independent review.
|
||||
## Code style
|
||||
|
||||
## Style Guidelines
|
||||
Solidity code should be written in a consistent format enforced by a linter, following the official [Solidity Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html). See below for further [Solidity Conventions](#solidity-conventions).
|
||||
|
||||
The design guidelines have quite a high abstraction level. These style guidelines are more concrete and easier to apply, and also more opinionated.
|
||||
The code should be simple and straightforward, prioritizing readability and understandability. Consistency and predictability should be maintained across the codebase. In particular, this applies to naming, which should be systematic, clear, and concise.
|
||||
|
||||
### General
|
||||
Sometimes these guidelines may be broken if doing so brings significant efficiency gains, but explanatory comments should be added.
|
||||
|
||||
#### G0 - Default to Solidity's official style guide.
|
||||
Modularity should be pursued, but not at the cost of the above priorities.
|
||||
|
||||
Follow the official Solidity style guide: https://solidity.readthedocs.io/en/latest/style-guide.html
|
||||
## Documentation
|
||||
|
||||
#### G1 - No Magic Constants
|
||||
For contributors, project guidelines and processes must be documented publicly.
|
||||
|
||||
Avoid constants in the code as much as possible. Magic strings are also magic constants.
|
||||
For users, features must be abundantly documented. Documentation should include answers to common questions, solutions to common problems, and recommendations for critical decisions that the user may face.
|
||||
|
||||
#### G2 - Code that Fails Early
|
||||
All changes to the core codebase (excluding tests, auxiliary scripts, etc.) must be documented in a changelog, except for purely cosmetic or documentation changes.
|
||||
|
||||
We ask our code to fail as soon as possible when an unexpected input was provided or unexpected state was found.
|
||||
## Peer review
|
||||
|
||||
#### G3 - Internal Amounts Must be Signed Integers and Represent the Smallest Units.
|
||||
All changes must be submitted through pull requests and go through peer code review.
|
||||
|
||||
Avoid representation errors by always dealing with weis when handling ether. GUIs can convert to more human-friendly representations. Use Signed Integers (int) to prevent underflow problems.
|
||||
The review must be approached by the reviewer in a similar way as if it was an audit of the code in question (but importantly it is not a substitute for and should not be considered an audit).
|
||||
|
||||
Reviewers should enforce code and project guidelines.
|
||||
|
||||
### Testing
|
||||
External contributions must be reviewed separately by multiple maintainers.
|
||||
|
||||
#### T1 - Tests Must be Written Elegantly
|
||||
## Automation
|
||||
|
||||
Style guidelines are not relaxed for tests. Tests are a good way to show how to use the library, and maintaining them is extremely necessary.
|
||||
Automation should be used as much as possible to reduce the possibility of human error and forgetfulness.
|
||||
|
||||
Don't write long tests, write helper functions to make them be as short and concise as possible (they should take just a few lines each), and use good variable names.
|
||||
Automations that make use of sensitive credentials must use secure secret management, and must be strengthened against attacks such as [those on GitHub Actions worklows](https://github.com/nikitastupin/pwnhub).
|
||||
|
||||
#### T2 - Tests Must not be Random
|
||||
Some other examples of automation are:
|
||||
|
||||
Inputs for tests should not be generated randomly. Accounts used to create test contracts are an exception, those can be random. Also, the type and structure of outputs should be checked.
|
||||
- Looking for common security vulnerabilities or errors in our code (eg. reentrancy analysis).
|
||||
- Keeping dependencies up to date and monitoring for vulnerable dependencies.
|
||||
|
||||
## Pull requests
|
||||
|
||||
Pull requests are squash-merged to keep the `master` branch history clean. The title of the pull request becomes the commit message, so it should be written in a consistent format:
|
||||
|
||||
1) Begin with a capital letter.
|
||||
2) Do not end with a period.
|
||||
3) Write in the imperative: "Add feature X" and not "Adds feature X" or "Added feature X".
|
||||
|
||||
This repository does not follow conventional commits, so do not prefix the title with "fix:" or "feat:".
|
||||
|
||||
Work in progress pull requests should be submitted as Drafts and should not be prefixed with "WIP:".
|
||||
|
||||
Branch names don't matter, and commit messages within a pull request mostly don't matter either, although they can help the review process.
|
||||
|
||||
# Solidity Conventions
|
||||
|
||||
In addition to the official Solidity Style Guide we have a number of other conventions that must be followed.
|
||||
|
||||
* All state variables should be private.
|
||||
|
||||
Changes to state should be accompanied by events, and in some cases it is not correct to arbitrarily set state. Encapsulating variables as private and only allowing modification via setters enables us to ensure that events and other rules are followed reliably and prevents this kind of user error.
|
||||
|
||||
* Internal or private state variables or functions should have an underscore prefix.
|
||||
|
||||
```solidity
|
||||
contract TestContract {
|
||||
uint256 private _privateVar;
|
||||
uint256 internal _internalVar;
|
||||
function _testInternal() internal { ... }
|
||||
function _testPrivate() private { ... }
|
||||
}
|
||||
```
|
||||
|
||||
* Events should be emitted immediately after the state change that they
|
||||
represent, and should be named in the past tense.
|
||||
|
||||
```solidity
|
||||
function _burn(address who, uint256 value) internal {
|
||||
super._burn(who, value);
|
||||
emit TokensBurned(who, value);
|
||||
}
|
||||
```
|
||||
|
||||
Some standards (e.g. ERC20) use present tense, and in those cases the
|
||||
standard specification is used.
|
||||
|
||||
* Interface names should have a capital I prefix.
|
||||
|
||||
```solidity
|
||||
interface IERC777 {
|
||||
```
|
||||
|
||||
* Unchecked arithmetic blocks should contain comments explaining why overflow is guaranteed not to happen. If the reason is immediately apparent from the line above the unchecked block, the comment may be omitted.
|
||||
|
||||
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-2019 zOS Global Limited
|
||||
Copyright (c) 2016-2023 zOS Global Limited and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
57
README.md
57
README.md
@ -1,60 +1,63 @@
|
||||
# <img src="logo.png" alt="OpenZeppelin" height="40px">
|
||||
# <img src="logo.svg" alt="OpenZeppelin" height="40px">
|
||||
|
||||
[](https://docs.openzeppelin.com/contracts)
|
||||
[](https://www.npmjs.org/package/@openzeppelin/contracts)
|
||||
[](https://circleci.com/gh/OpenZeppelin/openzeppelin-contracts)
|
||||
[](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts)
|
||||
[](https://www.gitpoap.io/gh/OpenZeppelin/openzeppelin-contracts)
|
||||
[](https://docs.openzeppelin.com/contracts)
|
||||
[](https://docs.openzeppelin.com/contracts)
|
||||
|
||||
**A library for secure smart contract development.** Build on a solid foundation of community-vetted code.
|
||||
|
||||
* Implementations of standards like [ERC20](https://docs.openzeppelin.com/contracts/erc20) and [ERC721](https://docs.openzeppelin.com/contracts/erc721).
|
||||
* Flexible [role-based permissioning](https://docs.openzeppelin.com/contracts/access-control) scheme.
|
||||
* Reusable [Solidity components](https://docs.openzeppelin.com/contracts/utilities) to build custom contracts and complex decentralized systems.
|
||||
* First-class integration with the [Gas Station Network](https://docs.openzeppelin.com/contracts/gsn) for systems with no gas fees!
|
||||
* Audited by leading security firms (_last full audit on v2.0.0_).
|
||||
|
||||
:mage: **Not sure how to get started?** Check out [Contracts Wizard](https://wizard.openzeppelin.com/) — an interactive smart contract generator.
|
||||
|
||||
:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) — a secure platform for automating and monitoring your operations.
|
||||
|
||||
## Overview
|
||||
|
||||
### Installation
|
||||
|
||||
```console
|
||||
```
|
||||
$ npm install @openzeppelin/contracts
|
||||
```
|
||||
|
||||
OpenZeppelin Contracts features a [stable API](https://docs.openzeppelin.com/contracts/releases-stability#api-stability), which means your contracts won't break unexpectedly when upgrading to a newer minor version.
|
||||
OpenZeppelin Contracts features a [stable API](https://docs.openzeppelin.com/contracts/releases-stability#api-stability), which means that your contracts won't break unexpectedly when upgrading to a newer minor version.
|
||||
|
||||
An alternative to npm is to use the GitHub repository (`openzeppelin/openzeppelin-contracts`) to retrieve the contracts. When doing this, make sure to specify the tag for a release such as `v4.5.0`, instead of using the `master` branch.
|
||||
|
||||
### Usage
|
||||
|
||||
Once installed, you can use the contracts in the library by importing them:
|
||||
|
||||
```solidity
|
||||
pragma solidity ^0.5.0;
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol";
|
||||
import "@openzeppelin/contracts/token/ERC721/ERC721Mintable.sol";
|
||||
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
||||
|
||||
contract MyNFT is ERC721Full, ERC721Mintable {
|
||||
constructor() ERC721Full("MyNFT", "MNFT") public {
|
||||
contract MyCollectible is ERC721 {
|
||||
constructor() ERC721("MyCollectible", "MCO") {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
_If you're new to smart contract development, head to [Developing Smart Contracts](https://docs.openzeppelin.com/learn/developing-smart-contracts) to learn about creating a new project and compiling your contracts._
|
||||
|
||||
To keep your system secure, you should **always** use the installed code as-is, and neither copy-paste it from online sources, nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don't need to worry about it needlessly increasing gas costs.
|
||||
To keep your system secure, you should **always** use the installed code as-is, and neither copy-paste it from online sources nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don't need to worry about it needlessly increasing gas costs.
|
||||
|
||||
## Learn More
|
||||
|
||||
The guides in the sidebar will teach about different concepts, and how to use the related contracts that OpenZeppelin Contracts provides:
|
||||
The guides in the [documentation site](https://docs.openzeppelin.com/contracts) will teach about different concepts, and how to use the related contracts that OpenZeppelin Contracts provides:
|
||||
|
||||
* [Access Control](https://docs.openzeppelin.com/contracts/access-control): decide who can perform each of the actions on your system.
|
||||
* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectives, and distribute them via [Crowdsales](https://docs.openzeppelin.com/contracts/crowdsales).
|
||||
* [Gas Station Network](https://docs.openzeppelin.com/contracts/gsn): let your users interact with your contracts without having to pay for gas themselves.
|
||||
* [Utilities](https://docs.openzeppelin.com/contracts/utilities): generic useful tools, including non-overflowing math, signature verification, and trustless paying systems.
|
||||
* [Utilities](https://docs.openzeppelin.com/contracts/utilities): generic useful tools including non-overflowing math, signature verification, and trustless paying systems.
|
||||
|
||||
The [full API](https://docs.openzeppelin.com/contracts/api/token/ERC20) is also thoroughly documented, and serves as a great reference when developing your smart contract application. You can also ask for help or follow Contracts's development in the [community forum](https://forum.openzeppelin.com).
|
||||
|
||||
Finally, you may want to take a look at the [guides on our blog](https://blog.openzeppelin.com/guides), which cover several common use cases and good practices.. The following articles provide great background reading, though please note, some of the referenced tools have changed as the tooling in the ecosystem continues to rapidly evolve.
|
||||
Finally, you may want to take a look at the [guides on our blog](https://blog.openzeppelin.com/guides), which cover several common use cases and good practices. The following articles provide great background reading, though please note that some of the referenced tools have changed, as the tooling in the ecosystem continues to rapidly evolve.
|
||||
|
||||
* [The Hitchhiker’s Guide to Smart Contracts in Ethereum](https://blog.openzeppelin.com/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05) will help you get an overview of the various tools available for smart contract development, and help you set up your environment.
|
||||
* [A Gentle Introduction to Ethereum Programming, Part 1](https://blog.openzeppelin.com/a-gentle-introduction-to-ethereum-programming-part-1-783cc7796094) provides very useful information on an introductory level, including many basic concepts from the Ethereum platform.
|
||||
@ -62,18 +65,26 @@ Finally, you may want to take a look at the [guides on our blog](https://blog.op
|
||||
|
||||
## Security
|
||||
|
||||
This project is maintained by [OpenZeppelin](https://openzeppelin.com), and developed following our high standards for code quality and security. OpenZeppelin is meant to provide tested and community-audited code, but please use common sense when doing anything that deals with real money! We take no responsibility for your implementation decisions and any security problems you might experience.
|
||||
This project is maintained by [OpenZeppelin](https://openzeppelin.com) with the goal of providing a secure and reliable library of smart contract components for the ecosystem. We address security through risk management in various areas such as engineering and open source best practices, scoping and API design, multi-layered review processes, and incident response preparedness.
|
||||
|
||||
The core development principles and strategies that OpenZeppelin is based on include: security in depth, simple and modular code, clarity-driven naming conventions, comprehensive unit testing, pre-and-post-condition sanity checks, code consistency, and regular audits.
|
||||
The security policy is detailed in [`SECURITY.md`](./SECURITY.md), and specifies how you can report security vulnerabilities, which versions will receive security patches, and how to stay informed about them. We run a [bug bounty program on Immunefi](https://immunefi.com/bounty/openzeppelin) to reward the responsible disclosure of vulnerabilities.
|
||||
|
||||
The latest audit was done on October 2018 on version 2.0.0.
|
||||
The engineering guidelines we follow to promote project quality can be found in [`GUIDELINES.md`](./GUIDELINES.md).
|
||||
|
||||
Please report any security issues you find to security@openzeppelin.org.
|
||||
Past audits can be found in [`audits/`](./audits).
|
||||
|
||||
Smart contracts are a nascent techology and carry a high level of technical risk and uncertainty. Although OpenZeppelin is well known for its security audits, using OpenZeppelin Contracts is not a substitute for a security audit.
|
||||
|
||||
OpenZeppelin Contracts is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including OpenZeppelin. As set out further in the Terms, you acknowledge that you are solely responsible for any use of OpenZeppelin Contracts and you assume all risks associated with any such use.
|
||||
|
||||
## Contribute
|
||||
|
||||
OpenZeppelin exists thanks to its contributors. There are many ways you can participate and help build high quality software. Check out the [contribution guide](CONTRIBUTING.md)!
|
||||
OpenZeppelin Contracts exists thanks to its contributors. There are many ways you can participate and help build high quality software. Check out the [contribution guide](CONTRIBUTING.md)!
|
||||
|
||||
## License
|
||||
|
||||
OpenZeppelin is released under the [MIT License](LICENSE).
|
||||
OpenZeppelin Contracts is released under the [MIT License](LICENSE).
|
||||
|
||||
## Legal
|
||||
|
||||
Your use of this Project is governed by the terms found at www.openzeppelin.com/tos (the "Terms").
|
||||
|
||||
55
RELEASING.md
55
RELEASING.md
@ -1,36 +1,47 @@
|
||||
# Releasing
|
||||
|
||||
> Visit the documentation for [details about release schedule].
|
||||
> Visit the documentation for [details about release schedule](https://docs.openzeppelin.com/contracts/releases-stability).
|
||||
|
||||
Start on an up-to-date `master` branch.
|
||||
OpenZeppelin Contracts uses a fully automated release process that takes care of compiling, packaging, and publishing the library, all of which is carried out in a clean CI environment (GitHub Actions), implemented in the ([`release-cycle`](.github/workflows/release-cycle.yml)) workflow. This helps to reduce the potential for human error and inconsistencies, and ensures that the release process is ongoing and reliable.
|
||||
|
||||
Create the release branch with `npm run release start minor`.
|
||||
## Changesets
|
||||
|
||||
Publish a release candidate with `npm run release rc`.
|
||||
[Changesets](https://github.com/changesets/changesets/) is used as part of our release process for `CHANGELOG.md` management. Each change that is relevant for the codebase is expected to include a changeset.
|
||||
|
||||
Publish the final release with `npm run release final`.
|
||||
## Branching model
|
||||
|
||||
Follow the general [OpenZeppelin release checklist].
|
||||
The release cycle happens on release branches called `release-vX.Y`. Each of these branches starts as a release candidate (rc) and is eventually promoted to final.
|
||||
|
||||
[details about release schedule]: https://docs.openzeppelin.com/contracts/releases-stability
|
||||
[OpenZeppelin release checklist]: https://github.com/OpenZeppelin/code-style/blob/master/RELEASE_CHECKLIST.md
|
||||
A release branch can be updated with cherry-picked patches from `master`, or may sometimes be committed to directly in the case of old releases. These commits will lead to a new release candidate or a patch increment depending on the state of the release branch.
|
||||
|
||||
```mermaid
|
||||
%%{init: {'gitGraph': {'mainBranchName': 'master'}} }%%
|
||||
gitGraph
|
||||
commit id: "Feature A"
|
||||
commit id: "Feature B"
|
||||
branch release-vX.Y
|
||||
commit id: "Start release"
|
||||
commit id: "Release vX.Y.0-rc.0"
|
||||
|
||||
## Merging the release branch
|
||||
checkout master
|
||||
commit id: "Feature C"
|
||||
commit id: "Fix A"
|
||||
|
||||
After the final release, the release branch should be merged back into `master`. This merge must not be squashed because it would lose the tagged release commit. Since the GitHub repo is set up to only allow squashed merges, the merge should be done locally and pushed.
|
||||
checkout release-vX.Y
|
||||
cherry-pick id: "Fix A" tag: ""
|
||||
commit id: "Release vX.Y.0-rc.1"
|
||||
commit id: "Release vX.Y.0"
|
||||
|
||||
Make sure to have the latest changes from `upstream` in your local release branch.
|
||||
checkout master
|
||||
merge release-vX.Y
|
||||
commit id: "Feature D"
|
||||
commit id: "Patch B"
|
||||
|
||||
checkout release-vX.Y
|
||||
cherry-pick id: "Patch B" tag: ""
|
||||
commit id: "Release vX.Y.1"
|
||||
|
||||
checkout master
|
||||
merge release-vX.Y
|
||||
commit id: "Feature E"
|
||||
```
|
||||
git checkout release-vX.Y.Z
|
||||
git pull upstream
|
||||
```
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git merge --no-ff release-vX.Y.Z
|
||||
git push upstream master
|
||||
```
|
||||
|
||||
The release branch can then be deleted on GitHub.
|
||||
|
||||
42
SECURITY.md
Normal file
42
SECURITY.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Security Policy
|
||||
|
||||
Security vulnerabilities should be disclosed to the project maintainers through [Immunefi], or alternatively by email to security@openzeppelin.com.
|
||||
|
||||
[Immunefi]: https://immunefi.com/bounty/openzeppelin
|
||||
|
||||
## Bug Bounty
|
||||
|
||||
Responsible disclosure of security vulnerabilities is rewarded through a bug bounty program on [Immunefi].
|
||||
|
||||
There is a bonus reward for issues introduced in release candidates that are reported before making it into a stable release.
|
||||
|
||||
## Security Patches
|
||||
|
||||
Security vulnerabilities will be patched as soon as responsibly possible, and published as an advisory on this repository (see [advisories]) and on the affected npm packages.
|
||||
|
||||
[advisories]: https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories
|
||||
|
||||
Projects that build on OpenZeppelin Contracts are encouraged to clearly state, in their source code and websites, how to be contacted about security issues in the event that a direct notification is considered necessary. We recommend including it in the NatSpec for the contract as `/// @custom:security-contact security@example.com`.
|
||||
|
||||
Additionally, we recommend installing the library through npm and setting up vulnerability alerts such as [Dependabot].
|
||||
|
||||
[Dependabot]: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-supply-chain-security#what-is-dependabot
|
||||
|
||||
### Supported Versions
|
||||
|
||||
Security patches will be released for the latest minor of a given major release. For example, if an issue is found in versions >=4.6.0 and the latest is 4.8.0, the patch will be released only in version 4.8.1.
|
||||
|
||||
Only critical severity bug fixes will be backported to past major releases.
|
||||
|
||||
| Version | Critical security fixes | Other security fixes |
|
||||
| ------- | ----------------------- | -------------------- |
|
||||
| 4.x | :white_check_mark: | :white_check_mark: |
|
||||
| 3.4 | :white_check_mark: | :x: |
|
||||
| 2.5 | :white_check_mark: | :x: |
|
||||
| < 2.0 | :x: | :x: |
|
||||
|
||||
Note as well that the Solidity language itself only guarantees security updates for the latest release.
|
||||
|
||||
## Legal
|
||||
|
||||
Smart contracts are a nascent techology and carry a high level of technical risk and uncertainty. OpenZeppelin Contracts is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including OpenZeppelin. Your use of the project is also governed by the terms found at www.openzeppelin.com/tos (the "Terms"). As set out in the Terms, you are solely responsible for any use of OpenZeppelin Contracts and you assume all risks associated with any such use. This Security Policy in no way evidences or represents an on-going duty by any contributor, including OpenZeppelin, to correct any flaws or alert you to all or any of the potential risks of utilizing the project.
|
||||
BIN
audit/2020-10-certora.pdf
Normal file
BIN
audit/2020-10-certora.pdf
Normal file
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
# OpenZeppelin Audit
|
||||
|
||||
NOTE ON 2021-07-19: This report makes reference to Zeppelin, OpenZeppelin, OpenZeppelin Contracts, the OpenZeppelin team, and OpenZeppelin library. Many of these things have since been renamed and know that this audit applies to what is currently called the OpenZeppelin Contracts which are maintained by the OpenZeppelin Contracts Community.
|
||||
|
||||
March, 2017
|
||||
Authored by Dennis Peterson and Peter Vessenes
|
||||
|
||||
@ -131,7 +133,7 @@ I presume that the goal of this contract is to allow and annotate a migration to
|
||||
|
||||
We like these pauses! Note that these allow significant griefing potential by owners, and that this might not be obvious to participants in smart contracts using the OpenZeppelin framework. We would recommend that additional sample logic be added to for instance the TokenContract showing safer use of the pause and resume functions. In particular, we would recommend a timelock after which anyone could unpause the contract.
|
||||
|
||||
The modifers use the pattern `if(bool){_;}`. This is fine for functions that return false upon failure, but could be problematic for functions expected to throw upon failure. See our comments above on standardizing on `throw` or `return(false)`.
|
||||
The modifiers use the pattern `if(bool){_;}`. This is fine for functions that return false upon failure, but could be problematic for functions expected to throw upon failure. See our comments above on standardizing on `throw` or `return(false)`.
|
||||
|
||||
## Ownership
|
||||
|
||||
BIN
audits/2022-10-Checkpoints.pdf
Normal file
BIN
audits/2022-10-Checkpoints.pdf
Normal file
Binary file not shown.
BIN
audits/2022-10-ERC4626.pdf
Normal file
BIN
audits/2022-10-ERC4626.pdf
Normal file
Binary file not shown.
15
audits/README.md
Normal file
15
audits/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Audits
|
||||
|
||||
| Date | Version | Commit | Auditor | Scope | Links |
|
||||
| ------------ | ------- | --------- | ------------ | -------------------- | ----------------------------------------------------------- |
|
||||
| October 2022 | v4.8.0 | `14f98db` | OpenZeppelin | ERC4626, Checkpoints | [🔗](./2022-10-ERC4626.pdf) [🔗](./2022-10-Checkpoints.pdf) |
|
||||
| October 2018 | v2.0.0 | `dac5bcc` | LevelK | Everything | [🔗](./2018-10.pdf) |
|
||||
| March 2017 | v1.0.4 | `9c5975a` | New Alchemy | Everything | [🔗](./2017-03.md) |
|
||||
|
||||
# Formal Verification
|
||||
|
||||
| Date | Version | Commit | Tool | Scope | Links |
|
||||
| ------------ | ------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
|
||||
| May 2022 | v4.7.0 | `109778c` | Certora | Initializable, GovernorPreventLateQuorum, ERC1155Burnable, ERC1155Pausable, ERC1155Supply, ERC1155Holder, ERC1155Receiver | [🔗](../certora/reports/2022-05.pdf) |
|
||||
| March 2022 | v4.4.0 | `4088540` | Certora | ERC20Votes, ERC20FlashMint, ERC20Wrapper, TimelockController, ERC721Votes, Votes, AccessControl, ERC1155 | [🔗](../certora/reports/2022-03.pdf) |
|
||||
| October 2021 | v4.4.0 | `4088540` | Certora | Governor, GovernorCountingSimple, GovernorProposalThreshold, GovernorTimelockControl, GovernorVotes, GovernorVotesQuorumFraction | [🔗](../certora/reports/2021-10.pdf) |
|
||||
1
certora/.gitignore
vendored
Normal file
1
certora/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
munged
|
||||
25
certora/Makefile
Normal file
25
certora/Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
default: help
|
||||
|
||||
PATCH = applyHarness.patch
|
||||
CONTRACTS_DIR = ../contracts
|
||||
MUNGED_DIR = munged
|
||||
|
||||
help:
|
||||
@echo "usage:"
|
||||
@echo " make clean: remove all generated files (those ignored by git)"
|
||||
@echo " make $(MUNGED_DIR): create $(MUNGED_DIR) directory by applying the patch file to $(CONTRACTS_DIR)"
|
||||
@echo " make record: record a new patch file capturing the differences between $(CONTRACTS_DIR) and $(MUNGED_DIR)"
|
||||
|
||||
munged: $(wildcard $(CONTRACTS_DIR)/*.sol) $(PATCH)
|
||||
rm -rf $@
|
||||
cp -r $(CONTRACTS_DIR) $@
|
||||
patch -p0 -d $@ < $(PATCH)
|
||||
|
||||
record:
|
||||
diff -druN $(CONTRACTS_DIR) $(MUNGED_DIR) | sed 's+../contracts/++g' | sed 's+munged/++g' > $(PATCH)
|
||||
|
||||
refresh: munged record
|
||||
|
||||
clean:
|
||||
git clean -fdX
|
||||
touch $(PATCH)
|
||||
56
certora/README.md
Normal file
56
certora/README.md
Normal file
@ -0,0 +1,56 @@
|
||||
# Running the certora verification tool
|
||||
|
||||
These instructions detail the process for running CVT on the OpenZeppelin (Wizard/Governor) contracts.
|
||||
|
||||
Documentation for CVT and the specification language are available
|
||||
[here](https://certora.atlassian.net/wiki/spaces/CPD/overview)
|
||||
|
||||
## Running the verification
|
||||
|
||||
The scripts in the `certora/scripts` directory are used to submit verification
|
||||
jobs to the Certora verification service. After the job is complete, the results will be available on
|
||||
[the Certora portal](https://vaas-stg.certora.com/).
|
||||
|
||||
These scripts should be run from the root directory; for example by running
|
||||
|
||||
```
|
||||
sh certora/scripts/verifyAll.sh <meaningful comment>
|
||||
```
|
||||
|
||||
The most important of these is `verifyAll.sh`, which checks
|
||||
all of the harnessed contracts (`certora/harness/Wizard*.sol`) against all of
|
||||
the specifications (`certora/spec/*.spec`).
|
||||
|
||||
The other scripts run a subset of the specifications or the contracts. You can
|
||||
verify different contracts or specifications by changing the `--verify` option,
|
||||
and you can run a single rule or method with the `--rule` or `--method` option.
|
||||
|
||||
For example, to verify the `WizardFirstPriority` contract against the
|
||||
`GovernorCountingSimple` specification, you could change the `--verify` line of
|
||||
the `WizardControlFirstPriortity.sh` script to:
|
||||
|
||||
```
|
||||
--verify WizardFirstPriority:certora/specs/GovernorCountingSimple.spec \
|
||||
```
|
||||
|
||||
## Adapting to changes in the contracts
|
||||
|
||||
Some of our rules require the code to be simplified in various ways. Our
|
||||
primary tool for performing these simplifications is to run verification on a
|
||||
contract that extends the original contracts and overrides some of the methods.
|
||||
These "harness" contracts can be found in the `certora/harness` directory.
|
||||
|
||||
This pattern does require some modifications to the original code: some methods
|
||||
need to be made virtual or public, for example. These changes are handled by
|
||||
applying a patch to the code before verification.
|
||||
|
||||
When one of the `verify` scripts is executed, it first applies the patch file
|
||||
`certora/applyHarness.patch` to the `contracts` directory, placing the output
|
||||
in the `certora/munged` directory. We then verify the contracts in the
|
||||
`certora/munged` directory.
|
||||
|
||||
If the original contracts change, it is possible to create a conflict with the
|
||||
patch. In this case, the verify scripts will report an error message and output
|
||||
rejected changes in the `munged` directory. After merging the changes, run
|
||||
`make record` in the `certora` directory; this will regenerate the patch file,
|
||||
which can then be checked into git.
|
||||
408
certora/applyHarness.patch
Normal file
408
certora/applyHarness.patch
Normal file
@ -0,0 +1,408 @@
|
||||
diff -druN governance/extensions/GovernorCountingSimple.sol governance/extensions/GovernorCountingSimple.sol
|
||||
--- governance/extensions/GovernorCountingSimple.sol 2023-02-27 10:59:32.652558153 +0100
|
||||
+++ governance/extensions/GovernorCountingSimple.sol 2023-02-28 16:49:10.417726143 +0100
|
||||
@@ -27,7 +27,7 @@
|
||||
mapping(address => bool) hasVoted;
|
||||
}
|
||||
|
||||
- mapping(uint256 => ProposalVote) private _proposalVotes;
|
||||
+ mapping(uint256 => ProposalVote) internal _proposalVotes; // HARNESS: private -> internal
|
||||
|
||||
/**
|
||||
* @dev See {IGovernor-COUNTING_MODE}.
|
||||
diff -druN governance/extensions/GovernorPreventLateQuorum.sol governance/extensions/GovernorPreventLateQuorum.sol
|
||||
--- governance/extensions/GovernorPreventLateQuorum.sol 2023-02-27 10:59:32.652558153 +0100
|
||||
+++ governance/extensions/GovernorPreventLateQuorum.sol 2023-02-28 16:49:10.417726143 +0100
|
||||
@@ -20,10 +20,10 @@
|
||||
abstract contract GovernorPreventLateQuorum is Governor {
|
||||
using SafeCast for uint256;
|
||||
|
||||
- uint64 private _voteExtension;
|
||||
+ uint64 internal _voteExtension; // HARNESS: private -> internal
|
||||
|
||||
/// @custom:oz-retyped-from mapping(uint256 => Timers.BlockNumber)
|
||||
- mapping(uint256 => uint64) private _extendedDeadlines;
|
||||
+ mapping(uint256 => uint64) internal _extendedDeadlines; // HARNESS: private -> internal
|
||||
|
||||
/// @dev Emitted when a proposal deadline is pushed back due to reaching quorum late in its voting period.
|
||||
event ProposalExtended(uint256 indexed proposalId, uint64 extendedDeadline);
|
||||
diff -druN governance/extensions/GovernorVotesQuorumFraction.sol governance/extensions/GovernorVotesQuorumFraction.sol
|
||||
--- governance/extensions/GovernorVotesQuorumFraction.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ governance/extensions/GovernorVotesQuorumFraction.sol 2023-02-28 16:49:10.417726143 +0100
|
||||
@@ -17,10 +17,10 @@
|
||||
using SafeCast for *;
|
||||
using Checkpoints for Checkpoints.Trace224;
|
||||
|
||||
- uint256 private _quorumNumerator; // DEPRECATED in favor of _quorumNumeratorHistory
|
||||
+ uint256 internal _quorumNumerator; // DEPRECATED // MUNGED private => internal
|
||||
|
||||
/// @custom:oz-retyped-from Checkpoints.History
|
||||
- Checkpoints.Trace224 private _quorumNumeratorHistory;
|
||||
+ Checkpoints.Trace224 internal _quorumNumeratorHistory; // MUNGED private => internal
|
||||
|
||||
event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);
|
||||
|
||||
diff -druN governance/Governor.sol governance/Governor.sol
|
||||
--- governance/Governor.sol 2023-02-27 10:59:32.652558153 +0100
|
||||
+++ governance/Governor.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -51,7 +51,7 @@
|
||||
string private _name;
|
||||
|
||||
/// @custom:oz-retyped-from mapping(uint256 => Governor.ProposalCore)
|
||||
- mapping(uint256 => ProposalCore) private _proposals;
|
||||
+ mapping(uint256 => ProposalCore) internal _proposals; // HARNESS: private -> internal
|
||||
|
||||
// This queue keeps track of the governor operating on itself. Calls to functions protected by the
|
||||
// {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute},
|
||||
diff -druN governance/TimelockController.sol governance/TimelockController.sol
|
||||
--- governance/TimelockController.sol 2023-02-27 10:59:32.652558153 +0100
|
||||
+++ governance/TimelockController.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -28,10 +28,10 @@
|
||||
bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE");
|
||||
bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE");
|
||||
bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE");
|
||||
- uint256 internal constant _DONE_TIMESTAMP = uint256(1);
|
||||
+ uint256 public constant _DONE_TIMESTAMP = uint256(1); // HARNESS: internal -> public
|
||||
|
||||
mapping(bytes32 => uint256) private _timestamps;
|
||||
- uint256 private _minDelay;
|
||||
+ uint256 public _minDelay; // HARNESS: private -> public
|
||||
|
||||
/**
|
||||
* @dev Emitted when a call is scheduled as part of operation `id`.
|
||||
diff -druN governance/utils/Votes.sol governance/utils/Votes.sol
|
||||
--- governance/utils/Votes.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ governance/utils/Votes.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -35,7 +35,25 @@
|
||||
bytes32 private constant _DELEGATION_TYPEHASH =
|
||||
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
|
||||
|
||||
- mapping(address => address) private _delegation;
|
||||
+ // HARNESS : Hooks cannot access any information from Checkpoints yet, so I am also updating votes and fromBlock in this struct
|
||||
+ struct Ckpt {
|
||||
+ uint32 fromBlock;
|
||||
+ uint224 votes;
|
||||
+ }
|
||||
+ mapping(address => Ckpt) public _checkpoints;
|
||||
+
|
||||
+ // HARNESSED getters
|
||||
+ function numCheckpoints(address account) public view returns (uint32) {
|
||||
+ return SafeCast.toUint32(_delegateCheckpoints[account]._checkpoints.length);
|
||||
+ }
|
||||
+ function ckptFromBlock(address account, uint32 pos) public view returns (uint32) {
|
||||
+ return _delegateCheckpoints[account]._checkpoints[pos]._key;
|
||||
+ }
|
||||
+ function ckptVotes(address account, uint32 pos) public view returns (uint224) {
|
||||
+ return _delegateCheckpoints[account]._checkpoints[pos]._value;
|
||||
+ }
|
||||
+
|
||||
+ mapping(address => address) public _delegation; // HARNESS: private -> public
|
||||
|
||||
/// @custom:oz-retyped-from mapping(address => Checkpoints.History)
|
||||
mapping(address => Checkpoints.Trace224) private _delegateCheckpoints;
|
||||
@@ -240,5 +258,5 @@
|
||||
/**
|
||||
* @dev Must return the voting units held by an account.
|
||||
*/
|
||||
- function _getVotingUnits(address) internal view virtual returns (uint256);
|
||||
+ function _getVotingUnits(address) public view virtual returns (uint256); // HARNESS: internal -> public
|
||||
}
|
||||
diff -druN proxy/utils/Initializable.sol proxy/utils/Initializable.sol
|
||||
--- proxy/utils/Initializable.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ proxy/utils/Initializable.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -60,12 +60,12 @@
|
||||
* @dev Indicates that the contract has been initialized.
|
||||
* @custom:oz-retyped-from bool
|
||||
*/
|
||||
- uint8 private _initialized;
|
||||
+ uint8 internal _initialized; // HARNESS: private -> internal
|
||||
|
||||
/**
|
||||
* @dev Indicates that the contract is in the process of being initialized.
|
||||
*/
|
||||
- bool private _initializing;
|
||||
+ bool internal _initializing; // HARNESS: private -> internal
|
||||
|
||||
/**
|
||||
* @dev Triggered when the contract has been initialized or reinitialized.
|
||||
diff -druN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol
|
||||
--- token/ERC1155/ERC1155.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ token/ERC1155/ERC1155.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -21,7 +21,7 @@
|
||||
using Address for address;
|
||||
|
||||
// Mapping from token ID to account balances
|
||||
- mapping(uint256 => mapping(address => uint256)) private _balances;
|
||||
+ mapping(uint256 => mapping(address => uint256)) internal _balances; // HARNESS: private -> internal
|
||||
|
||||
// Mapping from account to operator approvals
|
||||
mapping(address => mapping(address => bool)) private _operatorApprovals;
|
||||
@@ -451,7 +451,7 @@
|
||||
uint256 id,
|
||||
uint256 amount,
|
||||
bytes memory data
|
||||
- ) private {
|
||||
+ ) public { // HARNESS: private -> public
|
||||
if (to.isContract()) {
|
||||
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
|
||||
if (response != IERC1155Receiver.onERC1155Received.selector) {
|
||||
@@ -472,7 +472,7 @@
|
||||
uint256[] memory ids,
|
||||
uint256[] memory amounts,
|
||||
bytes memory data
|
||||
- ) private {
|
||||
+ ) public { // HARNESS: private -> public
|
||||
if (to.isContract()) {
|
||||
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
|
||||
bytes4 response
|
||||
diff -druN token/ERC20/ERC20.sol token/ERC20/ERC20.sol
|
||||
--- token/ERC20/ERC20.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ token/ERC20/ERC20.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -248,7 +248,7 @@
|
||||
*
|
||||
* - `account` cannot be the zero address.
|
||||
*/
|
||||
- function _mint(address account, uint256 amount) internal virtual {
|
||||
+ function _mint(address account, uint256 amount) public virtual { // HARNESS: internal -> public
|
||||
require(account != address(0), "ERC20: mint to the zero address");
|
||||
|
||||
_beforeTokenTransfer(address(0), account, amount);
|
||||
@@ -274,7 +274,7 @@
|
||||
* - `account` cannot be the zero address.
|
||||
* - `account` must have at least `amount` tokens.
|
||||
*/
|
||||
- function _burn(address account, uint256 amount) internal virtual {
|
||||
+ function _burn(address account, uint256 amount) public virtual { // HARNESS: internal -> public
|
||||
require(account != address(0), "ERC20: burn from the zero address");
|
||||
|
||||
_beforeTokenTransfer(account, address(0), amount);
|
||||
diff -druN token/ERC20/extensions/ERC20Capped.sol token/ERC20/extensions/ERC20Capped.sol
|
||||
--- token/ERC20/extensions/ERC20Capped.sol 2023-02-22 15:43:36.624717708 +0100
|
||||
+++ token/ERC20/extensions/ERC20Capped.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -30,7 +30,7 @@
|
||||
/**
|
||||
* @dev See {ERC20-_mint}.
|
||||
*/
|
||||
- function _mint(address account, uint256 amount) internal virtual override {
|
||||
+ function _mint(address account, uint256 amount) public virtual override { // HARNESS: internal -> public
|
||||
require(ERC20.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
|
||||
super._mint(account, amount);
|
||||
}
|
||||
diff -druN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20FlashMint.sol
|
||||
--- token/ERC20/extensions/ERC20FlashMint.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ token/ERC20/extensions/ERC20FlashMint.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -53,9 +53,11 @@
|
||||
// silence warning about unused variable without the addition of bytecode.
|
||||
token;
|
||||
amount;
|
||||
- return 0;
|
||||
+ return fee; // HARNESS: made "return" nonzero
|
||||
}
|
||||
|
||||
+ uint256 public fee; // HARNESS: added it to simulate random fee amount
|
||||
+
|
||||
/**
|
||||
* @dev Returns the receiver address of the flash fee. By default this
|
||||
* implementation returns the address(0) which means the fee amount will be burnt.
|
||||
diff -druN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol
|
||||
--- token/ERC20/extensions/ERC20Votes.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ token/ERC20/extensions/ERC20Votes.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -33,8 +33,8 @@
|
||||
bytes32 private constant _DELEGATION_TYPEHASH =
|
||||
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
|
||||
|
||||
- mapping(address => address) private _delegates;
|
||||
- mapping(address => Checkpoint[]) private _checkpoints;
|
||||
+ mapping(address => address) public _delegates; // HARNESS: private -> public
|
||||
+ mapping(address => Checkpoint[]) public _checkpoints; // HARNESS: private -> public
|
||||
Checkpoint[] private _totalSupplyCheckpoints;
|
||||
|
||||
/**
|
||||
@@ -186,27 +186,27 @@
|
||||
/**
|
||||
* @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1).
|
||||
*/
|
||||
- function _maxSupply() internal view virtual returns (uint224) {
|
||||
+ function _maxSupply() public view virtual returns (uint224) { // HARNESS: internal -> public
|
||||
return type(uint224).max;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Snapshots the totalSupply after it has been increased.
|
||||
*/
|
||||
- function _mint(address account, uint256 amount) internal virtual override {
|
||||
+ function _mint(address account, uint256 amount) public virtual override { // HARNESS: internal -> public
|
||||
super._mint(account, amount);
|
||||
require(totalSupply() <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes");
|
||||
|
||||
- _writeCheckpoint(_totalSupplyCheckpoints, _add, amount);
|
||||
+ _writeCheckpointAdd(_totalSupplyCheckpoints, amount); // HARNESS: new version without pointer
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Snapshots the totalSupply after it has been decreased.
|
||||
*/
|
||||
- function _burn(address account, uint256 amount) internal virtual override {
|
||||
+ function _burn(address account, uint256 amount) public virtual override { // HARNESS: internal -> public (to comply with the ERC20 harness)
|
||||
super._burn(account, amount);
|
||||
|
||||
- _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount);
|
||||
+ _writeCheckpointSub(_totalSupplyCheckpoints, amount); // HARNESS: new version without pointer
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@
|
||||
*
|
||||
* Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.
|
||||
*/
|
||||
- function _delegate(address delegator, address delegatee) internal virtual {
|
||||
+ function _delegate(address delegator, address delegatee) public virtual { // HARNESS: internal -> public
|
||||
address currentDelegate = delegates(delegator);
|
||||
uint256 delegatorBalance = balanceOf(delegator);
|
||||
_delegates[delegator] = delegatee;
|
||||
@@ -238,35 +238,60 @@
|
||||
function _moveVotingPower(address src, address dst, uint256 amount) private {
|
||||
if (src != dst && amount > 0) {
|
||||
if (src != address(0)) {
|
||||
- (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount);
|
||||
+ (uint256 oldWeight, uint256 newWeight) = _writeCheckpointSub(_checkpoints[src], amount); // HARNESS: new version without pointer
|
||||
emit DelegateVotesChanged(src, oldWeight, newWeight);
|
||||
}
|
||||
|
||||
if (dst != address(0)) {
|
||||
- (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount);
|
||||
+ (uint256 oldWeight, uint256 newWeight) = _writeCheckpointAdd(_checkpoints[dst], amount); // HARNESS: new version without pointer
|
||||
emit DelegateVotesChanged(dst, oldWeight, newWeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- function _writeCheckpoint(
|
||||
- Checkpoint[] storage ckpts,
|
||||
- function(uint256, uint256) view returns (uint256) op,
|
||||
- uint256 delta
|
||||
- ) private returns (uint256 oldWeight, uint256 newWeight) {
|
||||
+ // HARNESS: split _writeCheckpoint() to two functions as a workaround for function pointers that cannot be managed by the tool
|
||||
+ // function _writeCheckpoint(
|
||||
+ // Checkpoint[] storage ckpts,
|
||||
+ // function(uint256, uint256) view returns (uint256) op,
|
||||
+ // uint256 delta
|
||||
+ // ) private returns (uint256 oldWeight, uint256 newWeight) {
|
||||
+ // uint256 pos = ckpts.length;
|
||||
+
|
||||
+ // unchecked {
|
||||
+ // Checkpoint memory oldCkpt = pos == 0 ? Checkpoint(0, 0) : _unsafeAccess(ckpts, pos - 1);
|
||||
+
|
||||
+ // oldWeight = oldCkpt.votes;
|
||||
+ // newWeight = op(oldWeight, delta);
|
||||
+
|
||||
+ // if (pos > 0 && oldCkpt.fromBlock == clock()) {
|
||||
+ // _unsafeAccess(ckpts, pos - 1).votes = SafeCast.toUint224(newWeight);
|
||||
+ // } else {
|
||||
+ // ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
|
||||
+ // }
|
||||
+ // }
|
||||
+ // }
|
||||
+
|
||||
+ function _writeCheckpointAdd(Checkpoint[] storage ckpts, uint256 delta) private returns (uint256 oldWeight, uint256 newWeight) {
|
||||
uint256 pos = ckpts.length;
|
||||
+ oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
|
||||
+ newWeight = _add(oldWeight, delta);
|
||||
|
||||
- unchecked {
|
||||
- Checkpoint memory oldCkpt = pos == 0 ? Checkpoint(0, 0) : _unsafeAccess(ckpts, pos - 1);
|
||||
+ if (pos > 0 && ckpts[pos - 1].fromBlock == clock()) {
|
||||
+ ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
|
||||
+ } else {
|
||||
+ ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- oldWeight = oldCkpt.votes;
|
||||
- newWeight = op(oldWeight, delta);
|
||||
+ function _writeCheckpointSub(Checkpoint[] storage ckpts, uint256 delta) private returns (uint256 oldWeight, uint256 newWeight) {
|
||||
+ uint256 pos = ckpts.length;
|
||||
+ oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
|
||||
+ newWeight = _subtract(oldWeight, delta);
|
||||
|
||||
- if (pos > 0 && oldCkpt.fromBlock == clock()) {
|
||||
- _unsafeAccess(ckpts, pos - 1).votes = SafeCast.toUint224(newWeight);
|
||||
- } else {
|
||||
- ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
|
||||
- }
|
||||
+ if (pos > 0 && ckpts[pos - 1].fromBlock == clock()) {
|
||||
+ ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
|
||||
+ } else {
|
||||
+ ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
|
||||
}
|
||||
}
|
||||
|
||||
diff -druN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wrapper.sol
|
||||
--- token/ERC20/extensions/ERC20Wrapper.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ token/ERC20/extensions/ERC20Wrapper.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -62,7 +62,7 @@
|
||||
* @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal
|
||||
* function that can be exposed with access control if desired.
|
||||
*/
|
||||
- function _recover(address account) internal virtual returns (uint256) {
|
||||
+ function _recover(address account) public virtual returns (uint256) { // HARNESS: internal -> public
|
||||
uint256 value = _underlying.balanceOf(address(this)) - totalSupply();
|
||||
_mint(account, value);
|
||||
return value;
|
||||
diff -druN token/ERC721/extensions/ERC721Votes.sol token/ERC721/extensions/ERC721Votes.sol
|
||||
--- token/ERC721/extensions/ERC721Votes.sol 2023-02-27 10:59:32.655891529 +0100
|
||||
+++ token/ERC721/extensions/ERC721Votes.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -35,7 +35,7 @@
|
||||
/**
|
||||
* @dev Returns the balance of `account`.
|
||||
*/
|
||||
- function _getVotingUnits(address account) internal view virtual override returns (uint256) {
|
||||
+ function _getVotingUnits(address account) public view virtual override returns (uint256) { // HARNESS: internal -> public
|
||||
return balanceOf(account);
|
||||
}
|
||||
}
|
||||
diff -druN utils/Address.sol utils/Address.sol
|
||||
--- utils/Address.sol 2023-02-27 10:59:32.659224903 +0100
|
||||
+++ utils/Address.sol 2023-02-28 16:49:10.421059488 +0100
|
||||
@@ -197,7 +197,7 @@
|
||||
bool success,
|
||||
bytes memory returndata,
|
||||
string memory errorMessage
|
||||
- ) internal view returns (bytes memory) {
|
||||
+ ) internal view returns (bytes memory val) { // MUNGED undeterministic return causes error for Prover
|
||||
if (success) {
|
||||
if (returndata.length == 0) {
|
||||
// only check isContract if the call was successful and the return data is empty
|
||||
@@ -220,7 +220,7 @@
|
||||
bool success,
|
||||
bytes memory returndata,
|
||||
string memory errorMessage
|
||||
- ) internal pure returns (bytes memory) {
|
||||
+ ) internal pure returns (bytes memory val) { // MUNGED undeterministic return causes error for Prover
|
||||
if (success) {
|
||||
return returndata;
|
||||
} else {
|
||||
diff -druN utils/Checkpoints.sol utils/Checkpoints.sol
|
||||
--- utils/Checkpoints.sol 2023-02-27 10:59:32.659224903 +0100
|
||||
+++ utils/Checkpoints.sol 2023-02-28 16:49:10.424392833 +0100
|
||||
@@ -84,13 +84,13 @@
|
||||
*
|
||||
* Returns previous value and new value.
|
||||
*/
|
||||
- function push(
|
||||
- History storage self,
|
||||
- function(uint256, uint256) view returns (uint256) op,
|
||||
- uint256 delta
|
||||
- ) internal returns (uint256, uint256) {
|
||||
- return push(self, op(latest(self), delta));
|
||||
- }
|
||||
+ // function push(
|
||||
+ // History storage self,
|
||||
+ // function(uint256, uint256) view returns (uint256) op,
|
||||
+ // uint256 delta
|
||||
+ // ) internal returns (uint256, uint256) {
|
||||
+ // return push(self, op(latest(self), delta));
|
||||
+ // }
|
||||
|
||||
/**
|
||||
* @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.
|
||||
8
certora/harnesses/AccessControlHarness.sol
Normal file
8
certora/harnesses/AccessControlHarness.sol
Normal file
@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../munged/access/AccessControl.sol";
|
||||
|
||||
contract AccessControlHarness is AccessControl {}
|
||||
5
certora/harnesses/ERC1155/ERC1155BurnableHarness.sol
Normal file
5
certora/harnesses/ERC1155/ERC1155BurnableHarness.sol
Normal file
@ -0,0 +1,5 @@
|
||||
import "../../munged/token/ERC1155/extensions/ERC1155Burnable.sol";
|
||||
|
||||
contract ERC1155BurnableHarness is ERC1155Burnable {
|
||||
constructor(string memory uri_) ERC1155(uri_) {}
|
||||
}
|
||||
41
certora/harnesses/ERC1155/ERC1155Harness.sol
Normal file
41
certora/harnesses/ERC1155/ERC1155Harness.sol
Normal file
@ -0,0 +1,41 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
import "../../munged/token/ERC1155/ERC1155.sol";
|
||||
|
||||
contract ERC1155Harness is ERC1155 {
|
||||
constructor(string memory uri_) ERC1155(uri_) {}
|
||||
|
||||
function burn(
|
||||
address from,
|
||||
uint256 id,
|
||||
uint256 amount
|
||||
) public virtual {
|
||||
_burn(from, id, amount);
|
||||
}
|
||||
|
||||
function burnBatch(
|
||||
address from,
|
||||
uint256[] memory ids,
|
||||
uint256[] memory amounts
|
||||
) public virtual {
|
||||
_burnBatch(from, ids, amounts);
|
||||
}
|
||||
|
||||
function mint(
|
||||
address to,
|
||||
uint256 id,
|
||||
uint256 amount,
|
||||
bytes memory data
|
||||
) public virtual {
|
||||
_mint(to, id, amount, data);
|
||||
}
|
||||
|
||||
function mintBatch(
|
||||
address to,
|
||||
uint256[] memory ids,
|
||||
uint256[] memory amounts,
|
||||
bytes memory data
|
||||
) public virtual {
|
||||
_mintBatch(to, ids, amounts, data);
|
||||
}
|
||||
}
|
||||
17
certora/harnesses/ERC1155/ERC1155PausableHarness.sol
Normal file
17
certora/harnesses/ERC1155/ERC1155PausableHarness.sol
Normal file
@ -0,0 +1,17 @@
|
||||
import "../../munged/token/ERC1155/extensions/ERC1155Pausable.sol";
|
||||
|
||||
contract ERC1155PausableHarness is ERC1155Pausable {
|
||||
constructor(string memory uri_) ERC1155(uri_) {}
|
||||
|
||||
function pause() public {
|
||||
_pause();
|
||||
}
|
||||
|
||||
function unpause() public {
|
||||
_unpause();
|
||||
}
|
||||
|
||||
function onlyWhenPausedMethod() public whenPaused {}
|
||||
|
||||
function onlyWhenNotPausedMethod() public whenNotPaused {}
|
||||
}
|
||||
65
certora/harnesses/ERC1155/ERC1155SupplyHarness.sol
Normal file
65
certora/harnesses/ERC1155/ERC1155SupplyHarness.sol
Normal file
@ -0,0 +1,65 @@
|
||||
import "../../munged/token/ERC1155/extensions/ERC1155Supply.sol";
|
||||
|
||||
contract ERC1155SupplyHarness is ERC1155Supply {
|
||||
address public owner;
|
||||
|
||||
constructor(string memory uri_) ERC1155(uri_) {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
// workaround for problem caused by `exists` being a CVL keyword
|
||||
function exists_wrapper(uint256 id) public view virtual returns (bool) {
|
||||
return exists(id);
|
||||
}
|
||||
|
||||
// These rules were not implemented in the base but there are changes in supply
|
||||
// that are affected by the internal contracts so we implemented them. We assume
|
||||
// only the owner can call any of these functions to be able to test them but also
|
||||
// limit false positives.
|
||||
|
||||
modifier onlyOwner() {
|
||||
require(msg.sender == owner);
|
||||
_;
|
||||
}
|
||||
|
||||
function burn(
|
||||
address from,
|
||||
uint256 id,
|
||||
uint256 amount
|
||||
) public virtual onlyOwner {
|
||||
_burn(from, id, amount);
|
||||
}
|
||||
|
||||
function burnBatch(
|
||||
address from,
|
||||
uint256[] memory ids,
|
||||
uint256[] memory amounts
|
||||
) public virtual onlyOwner {
|
||||
_burnBatch(from, ids, amounts);
|
||||
}
|
||||
|
||||
function mint(
|
||||
address to,
|
||||
uint256 id,
|
||||
uint256 amount,
|
||||
bytes memory data
|
||||
) public virtual onlyOwner {
|
||||
_mint(to, id, amount, data);
|
||||
}
|
||||
|
||||
function mintBatch(
|
||||
address to,
|
||||
uint256[] memory ids,
|
||||
uint256[] memory amounts,
|
||||
bytes memory data
|
||||
) public virtual onlyOwner {
|
||||
_mintBatch(to, ids, amounts, data);
|
||||
}
|
||||
|
||||
// In order to check the invariant that zero address never holds any tokens, we need to remove the require
|
||||
// from this function.
|
||||
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
|
||||
// require(account != address(0), "ERC1155: address zero is not a valid owner");
|
||||
return _balances[id][account];
|
||||
}
|
||||
}
|
||||
5
certora/harnesses/ERC20FlashMintHarness.sol
Normal file
5
certora/harnesses/ERC20FlashMintHarness.sol
Normal file
@ -0,0 +1,5 @@
|
||||
import "../munged/token/ERC20/extensions/ERC20FlashMint.sol";
|
||||
|
||||
contract ERC20FlashMintHarness is ERC20FlashMint {
|
||||
constructor(string memory name, string memory symbol) ERC20(name, symbol) {}
|
||||
}
|
||||
5
certora/harnesses/ERC20PermitHarness.sol
Normal file
5
certora/harnesses/ERC20PermitHarness.sol
Normal file
@ -0,0 +1,5 @@
|
||||
import "../munged/token/ERC20/extensions/draft-ERC20Permit.sol";
|
||||
|
||||
contract ERC20PermitHarness is ERC20, ERC20Permit {
|
||||
constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {}
|
||||
}
|
||||
26
certora/harnesses/ERC20VotesHarness.sol
Normal file
26
certora/harnesses/ERC20VotesHarness.sol
Normal file
@ -0,0 +1,26 @@
|
||||
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
|
||||
|
||||
contract ERC20VotesHarness is ERC20Votes {
|
||||
constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {}
|
||||
|
||||
function ckptFromBlock(address account, uint32 pos) public view returns (uint32) {
|
||||
return _checkpoints[account][pos].fromBlock;
|
||||
}
|
||||
|
||||
function ckptVotes(address account, uint32 pos) public view returns (uint224) {
|
||||
return _checkpoints[account][pos].fromBlock;
|
||||
}
|
||||
|
||||
function unsafeNumCheckpoints(address account) public view returns (uint256) {
|
||||
return _checkpoints[account].length;
|
||||
}
|
||||
|
||||
function delegateBySig(
|
||||
address delegatee,
|
||||
uint256 nonce,
|
||||
uint256 expiry,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) public virtual override {}
|
||||
}
|
||||
17
certora/harnesses/ERC20WrapperHarness.sol
Normal file
17
certora/harnesses/ERC20WrapperHarness.sol
Normal file
@ -0,0 +1,17 @@
|
||||
import "../munged/token/ERC20/extensions/ERC20Wrapper.sol";
|
||||
|
||||
contract ERC20WrapperHarness is ERC20Wrapper {
|
||||
constructor(
|
||||
IERC20 _underlying,
|
||||
string memory _name,
|
||||
string memory _symbol
|
||||
) ERC20(_name, _symbol) ERC20Wrapper(_underlying) {}
|
||||
|
||||
function underlyingTotalSupply() public view returns (uint256) {
|
||||
return underlying().totalSupply();
|
||||
}
|
||||
|
||||
function underlyingBalanceOf(address account) public view returns (uint256) {
|
||||
return underlying().balanceOf(account);
|
||||
}
|
||||
}
|
||||
26
certora/harnesses/ERC721VotesHarness.sol
Normal file
26
certora/harnesses/ERC721VotesHarness.sol
Normal file
@ -0,0 +1,26 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../munged/token/ERC721/extensions/draft-ERC721Votes.sol";
|
||||
|
||||
contract ERC721VotesHarness is ERC721Votes {
|
||||
constructor(string memory name, string memory symbol) ERC721(name, symbol) EIP712(name, symbol) {}
|
||||
|
||||
function delegateBySig(
|
||||
address delegatee,
|
||||
uint256 nonce,
|
||||
uint256 expiry,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) public virtual override {
|
||||
assert(true);
|
||||
}
|
||||
|
||||
function mint(address account, uint256 tokenID) public {
|
||||
_mint(account, tokenID);
|
||||
}
|
||||
|
||||
function burn(uint256 tokenID) public {
|
||||
_burn(tokenID);
|
||||
}
|
||||
}
|
||||
206
certora/harnesses/GovernorFullHarness.sol
Normal file
206
certora/harnesses/GovernorFullHarness.sol
Normal file
@ -0,0 +1,206 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "../munged/governance/Governor.sol";
|
||||
import "../munged/governance/extensions/GovernorCountingSimple.sol";
|
||||
import "../munged/governance/extensions/GovernorPreventLateQuorum.sol";
|
||||
import "../munged/governance/extensions/GovernorTimelockControl.sol";
|
||||
import "../munged/governance/extensions/GovernorVotes.sol";
|
||||
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
|
||||
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
|
||||
|
||||
contract GovernorFullHarness is
|
||||
Governor,
|
||||
GovernorCountingSimple,
|
||||
GovernorTimelockControl,
|
||||
GovernorPreventLateQuorum,
|
||||
GovernorVotes,
|
||||
GovernorVotesQuorumFraction
|
||||
{
|
||||
using Checkpoints for Checkpoints.Trace224;
|
||||
|
||||
constructor(
|
||||
IVotes _token,
|
||||
TimelockController _timelock,
|
||||
uint64 initialVoteExtension,
|
||||
uint256 quorumNumeratorValue
|
||||
)
|
||||
Governor("Harness")
|
||||
GovernorPreventLateQuorum(initialVoteExtension)
|
||||
GovernorTimelockControl(_timelock)
|
||||
GovernorVotes(_token)
|
||||
GovernorVotesQuorumFraction(quorumNumeratorValue)
|
||||
{}
|
||||
|
||||
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
|
||||
|
||||
// Harness from Votes //
|
||||
|
||||
function getPastTotalSupply(uint256 blockNumber) public view returns(uint256) {
|
||||
return token.getPastTotalSupply(blockNumber);
|
||||
}
|
||||
// Harness from GovernorVotesQuorumFraction //
|
||||
|
||||
function getQuorumNumeratorLength() public view returns(uint256) {
|
||||
return _quorumNumeratorHistory._checkpoints.length;
|
||||
}
|
||||
|
||||
function getQuorumNumeratorLatest() public view returns(uint256) {
|
||||
return _quorumNumeratorHistory.latest();
|
||||
}
|
||||
|
||||
function getDeprecatedQuorumNumerator() public view returns(uint256) {
|
||||
return _quorumNumerator;
|
||||
}
|
||||
|
||||
// Harness from GovernorPreventLateQuorum //
|
||||
|
||||
function getVoteExtension() public view returns (uint64) {
|
||||
return _voteExtension;
|
||||
}
|
||||
|
||||
function getExtendedDeadline(uint256 proposalId) public view returns (uint64) {
|
||||
return _extendedDeadlines[proposalId];
|
||||
}
|
||||
|
||||
// Harness from GovernorCountingSimple //
|
||||
|
||||
function getAgainstVotes(uint256 proposalId) public view returns (uint256) {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
return proposalvote.againstVotes;
|
||||
}
|
||||
|
||||
function getAbstainVotes(uint256 proposalId) public view returns (uint256) {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
return proposalvote.abstainVotes;
|
||||
}
|
||||
|
||||
function getForVotes(uint256 proposalId) public view returns (uint256) {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
return proposalvote.forVotes;
|
||||
}
|
||||
|
||||
function quorumReached(uint256 proposalId) public view returns (bool) {
|
||||
return _quorumReached(proposalId);
|
||||
}
|
||||
|
||||
function voteSucceeded(uint256 proposalId) public view returns (bool) {
|
||||
return _voteSucceeded(proposalId);
|
||||
}
|
||||
|
||||
// Harness from Governor //
|
||||
|
||||
function getExecutor() public view returns (address) {
|
||||
return _executor();
|
||||
}
|
||||
|
||||
function proposalProposer(uint256 proposalId) public view returns (address) {
|
||||
return _proposalProposer(proposalId);
|
||||
}
|
||||
|
||||
function isExecuted(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].executed;
|
||||
}
|
||||
|
||||
function isCanceled(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].canceled;
|
||||
}
|
||||
|
||||
// The following functions are overrides required by Solidity added by Certora. //
|
||||
|
||||
function proposalDeadline(uint256 proposalId)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
override(Governor, GovernorPreventLateQuorum, IGovernor)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.proposalDeadline(proposalId);
|
||||
}
|
||||
|
||||
function _castVote(
|
||||
uint256 proposalId,
|
||||
address account,
|
||||
uint8 support,
|
||||
string memory reason,
|
||||
bytes memory params
|
||||
) internal virtual override(Governor, GovernorPreventLateQuorum) returns (uint256) {
|
||||
// added to run GovernorCountingSimple.spec
|
||||
uint256 deltaWeight = super._castVote(proposalId, account, support, reason, params);
|
||||
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
|
||||
|
||||
return deltaWeight;
|
||||
}
|
||||
|
||||
function lateQuorumVoteExtension() public view virtual override returns (uint64) {
|
||||
return super.lateQuorumVoteExtension();
|
||||
}
|
||||
|
||||
function setLateQuorumVoteExtension(uint64 newVoteExtension) public virtual override onlyGovernance {
|
||||
super.setLateQuorumVoteExtension(newVoteExtension);
|
||||
}
|
||||
|
||||
// The following functions are overrides required by Solidity added by OZ Wizard. //
|
||||
|
||||
function votingDelay() public pure override returns (uint256) {
|
||||
return 1; // 1 block
|
||||
}
|
||||
|
||||
function votingPeriod() public pure override returns (uint256) {
|
||||
return 45818; // 1 week
|
||||
}
|
||||
|
||||
function quorum(uint256 blockNumber)
|
||||
public
|
||||
view
|
||||
override(IGovernor, GovernorVotesQuorumFraction)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.quorum(blockNumber);
|
||||
}
|
||||
|
||||
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
|
||||
return super.state(proposalId);
|
||||
}
|
||||
|
||||
function propose(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
string memory description
|
||||
) public override(Governor, IGovernor) returns (uint256) {
|
||||
return super.propose(targets, values, calldatas, description);
|
||||
}
|
||||
|
||||
function _execute(
|
||||
uint256 proposalId,
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockControl) {
|
||||
super._execute(proposalId, targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _cancel(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
|
||||
return super._cancel(targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
|
||||
return super._executor();
|
||||
}
|
||||
|
||||
function supportsInterface(bytes4 interfaceId)
|
||||
public
|
||||
view
|
||||
override(Governor, GovernorTimelockControl)
|
||||
returns (bool)
|
||||
{
|
||||
return super.supportsInterface(interfaceId);
|
||||
}
|
||||
}
|
||||
154
certora/harnesses/GovernorHarness.sol
Normal file
154
certora/harnesses/GovernorHarness.sol
Normal file
@ -0,0 +1,154 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "../munged/governance/Governor.sol";
|
||||
import "../munged/governance/extensions/GovernorCountingSimple.sol";
|
||||
import "../munged/governance/extensions/GovernorTimelockControl.sol";
|
||||
import "../munged/governance/extensions/GovernorVotes.sol";
|
||||
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
|
||||
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
|
||||
|
||||
contract GovernorHarness is
|
||||
Governor,
|
||||
GovernorCountingSimple,
|
||||
GovernorVotes,
|
||||
GovernorVotesQuorumFraction,
|
||||
GovernorTimelockControl
|
||||
{
|
||||
constructor(
|
||||
IVotes _token,
|
||||
TimelockController _timelock,
|
||||
uint64 initialVoteExtension,
|
||||
uint256 quorumNumeratorValue
|
||||
)
|
||||
Governor("Harness")
|
||||
GovernorVotes(_token)
|
||||
GovernorVotesQuorumFraction(quorumNumeratorValue)
|
||||
GovernorTimelockControl(_timelock)
|
||||
{}
|
||||
|
||||
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
|
||||
|
||||
// Harness from GovernorCountingSimple //
|
||||
|
||||
function getAgainstVotes(uint256 proposalId) public view returns (uint256) {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
return proposalvote.againstVotes;
|
||||
}
|
||||
|
||||
function getAbstainVotes(uint256 proposalId) public view returns (uint256) {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
return proposalvote.abstainVotes;
|
||||
}
|
||||
|
||||
function getForVotes(uint256 proposalId) public view returns (uint256) {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
return proposalvote.forVotes;
|
||||
}
|
||||
|
||||
function quorumReached(uint256 proposalId) public view returns (bool) {
|
||||
return _quorumReached(proposalId);
|
||||
}
|
||||
|
||||
function voteSucceeded(uint256 proposalId) public view returns (bool) {
|
||||
return _voteSucceeded(proposalId);
|
||||
}
|
||||
|
||||
// Harness from Governor //
|
||||
|
||||
function getExecutor() public view returns (address) {
|
||||
return _executor();
|
||||
}
|
||||
|
||||
function proposalProposer(uint256 proposalId) public view returns (address) {
|
||||
return _proposalProposer(proposalId);
|
||||
}
|
||||
|
||||
function isExecuted(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].executed;
|
||||
}
|
||||
|
||||
function isCanceled(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].canceled;
|
||||
}
|
||||
|
||||
// The following functions are overrides required by Solidity added by Certora. //
|
||||
|
||||
function _castVote(
|
||||
uint256 proposalId,
|
||||
address account,
|
||||
uint8 support,
|
||||
string memory reason,
|
||||
bytes memory params
|
||||
) internal virtual override returns (uint256) {
|
||||
// added to run GovernorCountingSimple.spec
|
||||
uint256 deltaWeight = super._castVote(proposalId, account, support, reason, params);
|
||||
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
|
||||
|
||||
return deltaWeight;
|
||||
}
|
||||
|
||||
// The following functions are overrides required by Solidity added by OZ Wizard. //
|
||||
|
||||
function votingDelay() public pure override returns (uint256) {
|
||||
return 1; // 1 block
|
||||
}
|
||||
|
||||
function votingPeriod() public pure override returns (uint256) {
|
||||
return 45818; // 1 week
|
||||
}
|
||||
|
||||
function quorum(uint256 blockNumber)
|
||||
public
|
||||
view
|
||||
override(IGovernor, GovernorVotesQuorumFraction)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.quorum(blockNumber);
|
||||
}
|
||||
|
||||
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
|
||||
return super.state(proposalId);
|
||||
}
|
||||
|
||||
function propose(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
string memory description
|
||||
) public override(Governor, IGovernor) returns (uint256) {
|
||||
return super.propose(targets, values, calldatas, description);
|
||||
}
|
||||
|
||||
function _execute(
|
||||
uint256 proposalId,
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockControl) {
|
||||
super._execute(proposalId, targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _cancel(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
|
||||
return super._cancel(targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
|
||||
return super._executor();
|
||||
}
|
||||
|
||||
function supportsInterface(bytes4 interfaceId)
|
||||
public
|
||||
view
|
||||
override(Governor, GovernorTimelockControl)
|
||||
returns (bool)
|
||||
{
|
||||
return super.supportsInterface(interfaceId);
|
||||
}
|
||||
}
|
||||
20
certora/harnesses/IERC3156FlashBorrowerHarness.sol
Normal file
20
certora/harnesses/IERC3156FlashBorrowerHarness.sol
Normal file
@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashBorrower.sol)
|
||||
|
||||
import "../munged/interfaces/IERC3156FlashBorrower.sol";
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
contract IERC3156FlashBorrowerHarness is IERC3156FlashBorrower {
|
||||
bytes32 somethingToReturn;
|
||||
|
||||
function onFlashLoan(
|
||||
address initiator,
|
||||
address token,
|
||||
uint256 amount,
|
||||
uint256 fee,
|
||||
bytes calldata data
|
||||
) external override returns (bytes32) {
|
||||
return somethingToReturn;
|
||||
}
|
||||
}
|
||||
80
certora/harnesses/InitializableBasicHarness.sol
Normal file
80
certora/harnesses/InitializableBasicHarness.sol
Normal file
@ -0,0 +1,80 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "../munged/proxy/utils/Initializable.sol";
|
||||
|
||||
contract InitializableBasicHarness is Initializable {
|
||||
uint256 public val;
|
||||
uint256 public a;
|
||||
uint256 public b;
|
||||
|
||||
modifier version1() {
|
||||
require(_initialized == 1);
|
||||
_;
|
||||
}
|
||||
|
||||
modifier versionN(uint8 n) {
|
||||
require(_initialized == n);
|
||||
_;
|
||||
}
|
||||
|
||||
function initialize(
|
||||
uint256 _val,
|
||||
uint256 _a,
|
||||
uint256 _b
|
||||
) public initializer {
|
||||
a = _a;
|
||||
b = _b;
|
||||
val = _val;
|
||||
}
|
||||
|
||||
function reinitialize(
|
||||
uint256 _val,
|
||||
uint256 _a,
|
||||
uint256 _b,
|
||||
uint8 n
|
||||
) public reinitializer(n) {
|
||||
a = _a;
|
||||
b = _b;
|
||||
val = _val;
|
||||
}
|
||||
|
||||
// Versioned return functions for testing
|
||||
|
||||
function returnsV1() public view version1 returns (uint256) {
|
||||
return val;
|
||||
}
|
||||
|
||||
function returnsVN(uint8 n) public view versionN(n) returns (uint256) {
|
||||
return val;
|
||||
}
|
||||
|
||||
function returnsAV1() public view version1 returns (uint256) {
|
||||
return a;
|
||||
}
|
||||
|
||||
function returnsAVN(uint8 n) public view versionN(n) returns (uint256) {
|
||||
return a;
|
||||
}
|
||||
|
||||
function returnsBV1() public view version1 returns (uint256) {
|
||||
return b;
|
||||
}
|
||||
|
||||
function returnsBVN(uint8 n) public view versionN(n) returns (uint256) {
|
||||
return b;
|
||||
}
|
||||
|
||||
// Harness //
|
||||
function initialized() public view returns (uint8) {
|
||||
return _initialized;
|
||||
}
|
||||
|
||||
function initializing() public view returns (bool) {
|
||||
return _initializing;
|
||||
}
|
||||
|
||||
function thisIsContract() public view returns (bool) {
|
||||
return !Address.isContract(address(this));
|
||||
}
|
||||
}
|
||||
92
certora/harnesses/InitializableComplexHarness.sol
Normal file
92
certora/harnesses/InitializableComplexHarness.sol
Normal file
@ -0,0 +1,92 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "../munged/proxy/utils/Initializable.sol";
|
||||
|
||||
contract InitializableA is Initializable {
|
||||
uint256 public a;
|
||||
|
||||
modifier version1() {
|
||||
require(_initialized == 1);
|
||||
_;
|
||||
}
|
||||
|
||||
modifier versionN(uint8 n) {
|
||||
require(_initialized == n);
|
||||
_;
|
||||
}
|
||||
|
||||
function __InitializableA_init(uint256 _a) internal onlyInitializing {
|
||||
a = _a;
|
||||
}
|
||||
|
||||
function returnsAV1() public view version1 returns (uint256) {
|
||||
return a;
|
||||
}
|
||||
|
||||
function returnsAVN(uint8 n) public view versionN(n) returns (uint256) {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
contract InitializableB is Initializable, InitializableA {
|
||||
uint256 public b;
|
||||
|
||||
function __InitializableB_init(uint256 _b) internal onlyInitializing {
|
||||
b = _b;
|
||||
}
|
||||
|
||||
function returnsBV1() public view version1 returns (uint256) {
|
||||
return b;
|
||||
}
|
||||
|
||||
function returnsBVN(uint8 n) public view versionN(n) returns (uint256) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
contract InitializableComplexHarness is Initializable, InitializableB {
|
||||
uint256 public val;
|
||||
|
||||
function initialize(
|
||||
uint256 _val,
|
||||
uint256 _a,
|
||||
uint256 _b
|
||||
) public initializer {
|
||||
val = _val;
|
||||
__InitializableA_init(_a);
|
||||
__InitializableB_init(_b);
|
||||
}
|
||||
|
||||
function reinitialize(
|
||||
uint256 _val,
|
||||
uint256 _a,
|
||||
uint256 _b,
|
||||
uint8 n
|
||||
) public reinitializer(n) {
|
||||
val = _val;
|
||||
__InitializableA_init(_a);
|
||||
__InitializableB_init(_b);
|
||||
}
|
||||
|
||||
function returnsV1() public view version1 returns (uint256) {
|
||||
return val;
|
||||
}
|
||||
|
||||
function returnsVN(uint8 n) public view versionN(n) returns (uint256) {
|
||||
return val;
|
||||
}
|
||||
|
||||
// Harness //
|
||||
function initialized() public view returns (uint8) {
|
||||
return _initialized;
|
||||
}
|
||||
|
||||
function initializing() public view returns (bool) {
|
||||
return _initializing;
|
||||
}
|
||||
|
||||
function thisIsContract() public view returns (bool) {
|
||||
return !Address.isContract(address(this));
|
||||
}
|
||||
}
|
||||
12
certora/harnesses/TimelockControllerHarness.sol
Normal file
12
certora/harnesses/TimelockControllerHarness.sol
Normal file
@ -0,0 +1,12 @@
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../munged/governance/TimelockController.sol";
|
||||
|
||||
contract TimelockControllerHarness is TimelockController {
|
||||
constructor(
|
||||
uint256 minDelay,
|
||||
address[] memory proposers,
|
||||
address[] memory executors,
|
||||
address admin
|
||||
) TimelockController(minDelay, proposers, executors, admin) {}
|
||||
}
|
||||
159
certora/harnesses/WizardControlFirstPriority.sol
Normal file
159
certora/harnesses/WizardControlFirstPriority.sol
Normal file
@ -0,0 +1,159 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "../munged/governance/Governor.sol";
|
||||
import "../munged/governance/extensions/GovernorCountingSimple.sol";
|
||||
import "../munged/governance/extensions/GovernorVotes.sol";
|
||||
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
|
||||
import "../munged/governance/extensions/GovernorTimelockControl.sol";
|
||||
import "../munged/governance/extensions/GovernorProposalThreshold.sol";
|
||||
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
|
||||
|
||||
/*
|
||||
Wizard options:
|
||||
ProposalThreshhold = 10
|
||||
ERC20Votes
|
||||
TimelockController
|
||||
*/
|
||||
|
||||
contract WizardControlFirstPriority is
|
||||
Governor,
|
||||
GovernorProposalThreshold,
|
||||
GovernorCountingSimple,
|
||||
GovernorVotes,
|
||||
GovernorVotesQuorumFraction,
|
||||
GovernorTimelockControl
|
||||
{
|
||||
constructor(
|
||||
ERC20Votes _token,
|
||||
TimelockController _timelock,
|
||||
string memory name,
|
||||
uint256 quorumFraction
|
||||
)
|
||||
Governor(name)
|
||||
GovernorVotes(_token)
|
||||
GovernorVotesQuorumFraction(quorumFraction)
|
||||
GovernorTimelockControl(_timelock)
|
||||
{}
|
||||
|
||||
//HARNESS
|
||||
|
||||
function isExecuted(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].executed;
|
||||
}
|
||||
|
||||
function isCanceled(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].canceled;
|
||||
}
|
||||
|
||||
uint256 _votingDelay;
|
||||
|
||||
uint256 _votingPeriod;
|
||||
|
||||
uint256 _proposalThreshold;
|
||||
|
||||
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
|
||||
|
||||
function _castVote(
|
||||
uint256 proposalId,
|
||||
address account,
|
||||
uint8 support,
|
||||
string memory reason
|
||||
) internal virtual override returns (uint256) {
|
||||
uint256 deltaWeight = super._castVote(proposalId, account, support, reason); //HARNESS
|
||||
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
|
||||
|
||||
return deltaWeight;
|
||||
}
|
||||
|
||||
function snapshot(uint256 proposalId) public view returns (uint64) {
|
||||
return _proposals[proposalId].voteStart._deadline;
|
||||
}
|
||||
|
||||
function getExecutor() public view returns (address) {
|
||||
return _executor();
|
||||
}
|
||||
|
||||
// original code, harnessed
|
||||
|
||||
function votingDelay() public view override returns (uint256) {
|
||||
// HARNESS: pure -> view
|
||||
return _votingDelay; // HARNESS: parametric
|
||||
}
|
||||
|
||||
function votingPeriod() public view override returns (uint256) {
|
||||
// HARNESS: pure -> view
|
||||
return _votingPeriod; // HARNESS: parametric
|
||||
}
|
||||
|
||||
function proposalThreshold() public view override returns (uint256) {
|
||||
// HARNESS: pure -> view
|
||||
return _proposalThreshold; // HARNESS: parametric
|
||||
}
|
||||
|
||||
// original code, not harnessed
|
||||
// The following functions are overrides required by Solidity.
|
||||
|
||||
function quorum(uint256 blockNumber)
|
||||
public
|
||||
view
|
||||
override(IGovernor, GovernorVotesQuorumFraction)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.quorum(blockNumber);
|
||||
}
|
||||
|
||||
function getVotes(address account, uint256 blockNumber)
|
||||
public
|
||||
view
|
||||
override(IGovernor, Governor)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.getVotes(account, blockNumber);
|
||||
}
|
||||
|
||||
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
|
||||
return super.state(proposalId);
|
||||
}
|
||||
|
||||
function propose(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
string memory description
|
||||
) public override(Governor, GovernorProposalThreshold, IGovernor) returns (uint256) {
|
||||
return super.propose(targets, values, calldatas, description);
|
||||
}
|
||||
|
||||
function _execute(
|
||||
uint256 proposalId,
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockControl) {
|
||||
super._execute(proposalId, targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _cancel(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
|
||||
return super._cancel(targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
|
||||
return super._executor();
|
||||
}
|
||||
|
||||
function supportsInterface(bytes4 interfaceId)
|
||||
public
|
||||
view
|
||||
override(Governor, GovernorTimelockControl)
|
||||
returns (bool)
|
||||
{
|
||||
return super.supportsInterface(interfaceId);
|
||||
}
|
||||
}
|
||||
154
certora/harnesses/WizardFirstTry.sol
Normal file
154
certora/harnesses/WizardFirstTry.sol
Normal file
@ -0,0 +1,154 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "../munged/governance/Governor.sol";
|
||||
import "../munged/governance/extensions/GovernorCountingSimple.sol";
|
||||
import "../munged/governance/extensions/GovernorVotes.sol";
|
||||
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
|
||||
import "../munged/governance/extensions/GovernorTimelockCompound.sol";
|
||||
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
|
||||
|
||||
/*
|
||||
Wizard options:
|
||||
ERC20Votes
|
||||
TimelockCompound
|
||||
*/
|
||||
|
||||
contract WizardFirstTry is
|
||||
Governor,
|
||||
GovernorCountingSimple,
|
||||
GovernorVotes,
|
||||
GovernorVotesQuorumFraction,
|
||||
GovernorTimelockCompound
|
||||
{
|
||||
constructor(
|
||||
ERC20Votes _token,
|
||||
ICompoundTimelock _timelock,
|
||||
string memory name,
|
||||
uint256 quorumFraction
|
||||
)
|
||||
Governor(name)
|
||||
GovernorVotes(_token)
|
||||
GovernorVotesQuorumFraction(quorumFraction)
|
||||
GovernorTimelockCompound(_timelock)
|
||||
{}
|
||||
|
||||
//HARNESS
|
||||
|
||||
function isExecuted(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].executed;
|
||||
}
|
||||
|
||||
function isCanceled(uint256 proposalId) public view returns (bool) {
|
||||
return _proposals[proposalId].canceled;
|
||||
}
|
||||
|
||||
function snapshot(uint256 proposalId) public view returns (uint64) {
|
||||
return _proposals[proposalId].voteStart._deadline;
|
||||
}
|
||||
|
||||
function getExecutor() public view returns (address) {
|
||||
return _executor();
|
||||
}
|
||||
|
||||
uint256 _votingDelay;
|
||||
|
||||
uint256 _votingPeriod;
|
||||
|
||||
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
|
||||
|
||||
function _castVote(
|
||||
uint256 proposalId,
|
||||
address account,
|
||||
uint8 support,
|
||||
string memory reason
|
||||
) internal virtual override returns (uint256) {
|
||||
uint256 deltaWeight = super._castVote(proposalId, account, support, reason); //HARNESS
|
||||
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
|
||||
|
||||
return deltaWeight;
|
||||
}
|
||||
|
||||
// original code, harnessed
|
||||
|
||||
function votingDelay() public view virtual override returns (uint256) {
|
||||
// HARNESS: pure -> view
|
||||
return _votingDelay; // HARNESS: parametric
|
||||
}
|
||||
|
||||
function votingPeriod() public view virtual override returns (uint256) {
|
||||
// HARNESS: pure -> view
|
||||
return _votingPeriod; // HARNESS: parametric
|
||||
}
|
||||
|
||||
// original code, not harnessed
|
||||
// The following functions are overrides required by Solidity.
|
||||
|
||||
function quorum(uint256 blockNumber)
|
||||
public
|
||||
view
|
||||
override(IGovernor, GovernorVotesQuorumFraction)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.quorum(blockNumber);
|
||||
}
|
||||
|
||||
function getVotes(address account, uint256 blockNumber)
|
||||
public
|
||||
view
|
||||
override(IGovernor, Governor)
|
||||
returns (uint256)
|
||||
{
|
||||
return super.getVotes(account, blockNumber);
|
||||
}
|
||||
|
||||
function state(uint256 proposalId)
|
||||
public
|
||||
view
|
||||
override(Governor, GovernorTimelockCompound)
|
||||
returns (ProposalState)
|
||||
{
|
||||
return super.state(proposalId);
|
||||
}
|
||||
|
||||
function propose(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
string memory description
|
||||
) public override(Governor, IGovernor) returns (uint256) {
|
||||
return super.propose(targets, values, calldatas, description);
|
||||
}
|
||||
|
||||
function _execute(
|
||||
uint256 proposalId,
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockCompound) {
|
||||
super._execute(proposalId, targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _cancel(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 descriptionHash
|
||||
) internal override(Governor, GovernorTimelockCompound) returns (uint256) {
|
||||
return super._cancel(targets, values, calldatas, descriptionHash);
|
||||
}
|
||||
|
||||
function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
|
||||
return super._executor();
|
||||
}
|
||||
|
||||
function supportsInterface(bytes4 interfaceId)
|
||||
public
|
||||
view
|
||||
override(Governor, GovernorTimelockCompound)
|
||||
returns (bool)
|
||||
{
|
||||
return super.supportsInterface(interfaceId);
|
||||
}
|
||||
}
|
||||
BIN
certora/reports/2021-10.pdf
Normal file
BIN
certora/reports/2021-10.pdf
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user