Compare commits
999 Commits
@0x/react-
...
@0x/sol-re
Author | SHA1 | Date | |
---|---|---|---|
|
ec92cea598 | ||
|
0e25f8ba32 | ||
|
23602ec6b4 | ||
|
f4da2a129d | ||
|
ab6938f614 | ||
|
09ec6d637b | ||
|
703e8e06a3 | ||
|
47f30d097a | ||
|
5c18b394a4 | ||
|
fb5afafbbe | ||
|
b3f71af850 | ||
|
093fb6e68d | ||
|
a8ae2b7355 | ||
|
d45f64ab06 | ||
|
050343c97a | ||
|
64f5aaccd7 | ||
|
856472452a | ||
|
f06e7a511e | ||
|
f6bd8c939c | ||
|
d09040d1d3 | ||
|
00fcdbd43a | ||
|
4dfd91e2df | ||
|
50f86dd61b | ||
|
9c219159c6 | ||
|
e1195a3444 | ||
|
7fe4a03683 | ||
|
803505cacc | ||
|
e05e118bd2 | ||
|
c883f5ea41 | ||
|
0567b3332b | ||
|
cc2833b372 | ||
|
0165d67dc1 | ||
|
1a4489b96a | ||
|
1ecc4a14ca | ||
|
9eba6d7146 | ||
|
3724ac4b67 | ||
|
d912175a7a | ||
|
5f23eee6dc | ||
|
5fe607557d | ||
|
5d6584b0eb | ||
|
7bdb77d93f | ||
|
2530d47fde | ||
|
2b8226a757 | ||
|
92d5adaac4 | ||
|
0c9daa693e | ||
|
89729e828c | ||
|
c2113caae1 | ||
|
e0adb6624d | ||
|
022855add0 | ||
|
4dd1c48dc8 | ||
|
cdc2393aa6 | ||
|
94f94bdda7 | ||
|
3264bd223d | ||
|
6292c0703c | ||
|
9a28079f2a | ||
|
c612649f02 | ||
|
eda44d1ffb | ||
|
4c2f77c014 | ||
|
6b8bbd3d5f | ||
|
e914e1b7fa | ||
|
3d2ce749a8 | ||
|
9892d8d6d2 | ||
|
218a7ab810 | ||
|
6779e52813 | ||
|
5d51b40541 | ||
|
b12b7069f7 | ||
|
10a5d38446 | ||
|
e39e7a934e | ||
|
b7127d8506 | ||
|
a12e07b1a8 | ||
|
8ff5c0a603 | ||
|
c5c8506cc6 | ||
|
dbef531d66 | ||
|
4e9c9ca079 | ||
|
d7c61fea4c | ||
|
08dc5fafa0 | ||
|
78493a9d98 | ||
|
e274d8994a | ||
|
2dee887e6f | ||
|
f7eb20a235 | ||
|
f3cea0ebd0 | ||
|
05e00d278f | ||
|
107c7a71f9 | ||
|
56698fb09e | ||
|
55bb6f89d3 | ||
|
47d77cbddd | ||
|
2547e0e5b1 | ||
|
1a4699ecac | ||
|
c825643b67 | ||
|
a425d3a234 | ||
|
3041e7459e | ||
|
1fb9d54174 | ||
|
598607f5a3 | ||
|
5c5bb20415 | ||
|
6199a17791 | ||
|
7dd42ad6aa | ||
|
c7fd85633d | ||
|
b3df71bebf | ||
|
88d95ebdbc | ||
|
140cf4d378 | ||
|
451a19117f | ||
|
aa6ab33b93 | ||
|
8ec04271f3 | ||
|
f583de652f | ||
|
96cd9de8a6 | ||
|
9a17cb4c92 | ||
|
021cba9fad | ||
|
47f4321611 | ||
|
775a41a789 | ||
|
f6c61ed79f | ||
|
152e057e08 | ||
|
8b84ecc593 | ||
|
9c10babefd | ||
|
67193d9472 | ||
|
7d04dd9520 | ||
|
93bda7972c | ||
|
92c0e34ed2 | ||
|
c0a471b349 | ||
|
2543076d16 | ||
|
e32bb6fc0f | ||
|
7020166473 | ||
|
16ae47f2ad | ||
|
abf1141ad8 | ||
|
3790e0a741 | ||
|
9e1966b4fe | ||
|
38e06e57a3 | ||
|
7f2fc90677 | ||
|
1f0ab54fc5 | ||
|
7f8c11a74c | ||
|
7a4d64d90d | ||
|
7217bfa35e | ||
|
25077affc8 | ||
|
7a80583655 | ||
|
c21fe0cb50 | ||
|
3d08e79089 | ||
|
c43db2d096 | ||
|
220856d084 | ||
|
a01eafa4e7 | ||
|
f9c2d25352 | ||
|
d2f77d74e6 | ||
|
c3b928c1f5 | ||
|
9dfa9c194e | ||
|
1a3dc6cefc | ||
|
1a73daf82a | ||
|
6b20c9a542 | ||
|
76c996250d | ||
|
52e8de9966 | ||
|
81ab84b087 | ||
|
e34755a1ef | ||
|
6c11b2ad8a | ||
|
ede6ecc3aa | ||
|
9db69f33e4 | ||
|
17d5d4648b | ||
|
e203b5593a | ||
|
de9aa063c0 | ||
|
077d001b42 | ||
|
dfd46d68ac | ||
|
4dbe137999 | ||
|
1ac5cb404f | ||
|
43ffa2dd77 | ||
|
1efa7935b7 | ||
|
b0835b005a | ||
|
30946ac110 | ||
|
9427858755 | ||
|
53864d3817 | ||
|
ab283ddd9b | ||
|
7efcf9066c | ||
|
219e09d157 | ||
|
d816551dba | ||
|
04c5752b8a | ||
|
ed12d8b95f | ||
|
f48852742d | ||
|
b84d89367a | ||
|
d8dab6a070 | ||
|
ac2443690c | ||
|
5df0f13eb0 | ||
|
24d782fb19 | ||
|
01a5472318 | ||
|
4b7a2e9d49 | ||
|
62936e3502 | ||
|
d6b3e4fbaa | ||
|
a5f011f4a4 | ||
|
c6efaab01d | ||
|
0f7282d9a9 | ||
|
a3b414a986 | ||
|
8a6d0b67f1 | ||
|
f78ff91975 | ||
|
c8e416f3b1 | ||
|
d61f67d24a | ||
|
258ffdcc94 | ||
|
1f93f09864 | ||
|
7afddb9309 | ||
|
5eb4dbd5d9 | ||
|
fc39ddfb71 | ||
|
ba04a8bc0c | ||
|
02d4a28402 | ||
|
ea2bf07ea6 | ||
|
b5dc734dc4 | ||
|
7dd9b0ba66 | ||
|
69a5c8a317 | ||
|
b975ac7c31 | ||
|
dcede832c8 | ||
|
f40bbbc238 | ||
|
361f5ca5cc | ||
|
a710ebe5b3 | ||
|
2becef23ff | ||
|
f916d293fa | ||
|
f312a260cc | ||
|
fd9b51c7db | ||
|
1dac6b6157 | ||
|
c2ba6b3a0f | ||
|
576bd5585f | ||
|
ae61a87190 | ||
|
2e8f2ae769 | ||
|
b507a308e6 | ||
|
ad83b17fdf | ||
|
e452cfcd59 | ||
|
6474a4e08c | ||
|
e78288ddfd | ||
|
6e2d0ab13d | ||
|
bfbc78c95c | ||
|
368ae86530 | ||
|
d8ccc1694d | ||
|
b4e10b1e06 | ||
|
05f76958ac | ||
|
1183cf5e6b | ||
|
bf9eb1413b | ||
|
38d48a8f20 | ||
|
ca222a470d | ||
|
49ca8840ea | ||
|
faaeba78bb | ||
|
6c37d47f2f | ||
|
185e53149f | ||
|
4329a252ee | ||
|
8d38d69684 | ||
|
edb5e50253 | ||
|
81ab2e75ca | ||
|
e0d8398cf7 | ||
|
4fd46d1c95 | ||
|
c217764fe0 | ||
|
42124274c7 | ||
|
562342ac99 | ||
|
14b573ebfd | ||
|
e3834c2fc0 | ||
|
c2f3757de7 | ||
|
4b0010be63 | ||
|
078af36e0e | ||
|
b17d12fe23 | ||
|
294c0b449b | ||
|
bc3927e973 | ||
|
a2cfdd2975 | ||
|
53b4f48b2e | ||
|
635b80440a | ||
|
f2d95477e6 | ||
|
1005e4962a | ||
|
487bc1a08b | ||
|
0cf768185e | ||
|
b5558a8cff | ||
|
af2b8dfde5 | ||
|
2bde5f7034 | ||
|
c38f913a84 | ||
|
44b4f91208 | ||
|
9c4ad6ac32 | ||
|
b151c0b701 | ||
|
d4b6db773f | ||
|
7da71c0955 | ||
|
32adb35c2a | ||
|
2f197d128a | ||
|
5415bc4590 | ||
|
f6086b8054 | ||
|
c9d77d7fa0 | ||
|
ab8c457c51 | ||
|
5d91ad3656 | ||
|
78ffca06ea | ||
|
0d71ec93e7 | ||
|
d4c771dc7d | ||
|
68004466bb | ||
|
4dd2d1afaf | ||
|
4947676434 | ||
|
ea5e83da03 | ||
|
0705276ff9 | ||
|
0299abf1b5 | ||
|
132394ffbe | ||
|
40edcef340 | ||
|
bf22eba795 | ||
|
e990272db3 | ||
|
401a0eadb1 | ||
|
5852e0b476 | ||
|
401df5f45d | ||
|
7da40fd7bc | ||
|
89740dc24c | ||
|
4d7ba42f8f | ||
|
bbd9c4ef67 | ||
|
de036ae96a | ||
|
e5985d7c3f | ||
|
fb54c45d7d | ||
|
f1b704a91a | ||
|
b99eab6804 | ||
|
82acc26f97 | ||
|
569a165c87 | ||
|
704adcb03d | ||
|
197cdee604 | ||
|
3dc5de936e | ||
|
d88eb6a5c9 | ||
|
a168f34538 | ||
|
7b150bab73 | ||
|
b0e38f79ea | ||
|
a68ebc27ed | ||
|
25705bd314 | ||
|
85c9b7d9c5 | ||
|
629c2ecba2 | ||
|
be0662a41d | ||
|
1985fec892 | ||
|
2cbdd76aa3 | ||
|
73ae0541d8 | ||
|
22621b9f76 | ||
|
c9f214504a | ||
|
e8a2d1240f | ||
|
f2e0fe49f7 | ||
|
4ce7bf56e7 | ||
|
29be232ae9 | ||
|
794c0342ee | ||
|
d5a22829ac | ||
|
b58d4005d3 | ||
|
c16d9d85a2 | ||
|
92aeca1f30 | ||
|
b81ed67975 | ||
|
2bc6582e6b | ||
|
b27311da2e | ||
|
ab8a0da16a | ||
|
800e37ed03 | ||
|
950e84fe5c | ||
|
fdbc235fd6 | ||
|
ffdb5c06f6 | ||
|
14f0f89798 | ||
|
54b53184b7 | ||
|
75b1cdac66 | ||
|
d21f394531 | ||
|
86d90599ca | ||
|
ec24976789 | ||
|
00eaa8bd34 | ||
|
5c44163d68 | ||
|
f73bad5c13 | ||
|
a063fa6fe0 | ||
|
894ad8af21 | ||
|
c01793599f | ||
|
63db393b60 | ||
|
5846166c85 | ||
|
25e941128a | ||
|
22964ff913 | ||
|
62a58667ba | ||
|
c868015989 | ||
|
565e5e5770 | ||
|
198831d084 | ||
|
d3be097436 | ||
|
1259de5be4 | ||
|
df6be48638 | ||
|
4923fdbb73 | ||
|
66964a5a2f | ||
|
97e24d0e14 | ||
|
fe0b75ef26 | ||
|
4b76efbc28 | ||
|
11cff4d391 | ||
|
59211c1c1e | ||
|
c0ab2e8127 | ||
|
d39e90bfa1 | ||
|
16e55457c8 | ||
|
ea2a453811 | ||
|
7d2a768a0c | ||
|
78304c4369 | ||
|
85f243e2e0 | ||
|
785ca4f5d1 | ||
|
730e8ad151 | ||
|
b3e6e23508 | ||
|
f09d56cdb9 | ||
|
b51933c4d9 | ||
|
477791a600 | ||
|
f0d6476f92 | ||
|
fa4accd0c4 | ||
|
e64754f554 | ||
|
5badb1eb5d | ||
|
9c52fd1f2a | ||
|
27e01b9249 | ||
|
5bf0de5519 | ||
|
139a4acb1b | ||
|
9d8b2d9e0c | ||
|
d16a0f1b56 | ||
|
edb63c0f26 | ||
|
bd3a80bcde | ||
|
9f0da8ec39 | ||
|
42ed4e393f | ||
|
99ffe6bb2d | ||
|
70898be894 | ||
|
9f1859575d | ||
|
0167689374 | ||
|
053c5f0f88 | ||
|
fa6516d0be | ||
|
7fb0e1b39c | ||
|
8ba439c263 | ||
|
1a1f24146c | ||
|
086fa31d04 | ||
|
b5e02d1b74 | ||
|
e88aee6ad9 | ||
|
fb4ead84f5 | ||
|
298967e639 | ||
|
903a9947a3 | ||
|
72beb59d63 | ||
|
75dd1be40e | ||
|
6a7c2918bb | ||
|
9b9ee2415d | ||
|
f1f38fb8b0 | ||
|
1e44bcb7c9 | ||
|
11e689156e | ||
|
6c792e89f9 | ||
|
11026fe36a | ||
|
3133dde3a3 | ||
|
b666ca0271 | ||
|
de5c6c1ed0 | ||
|
34f4cf133b | ||
|
1ba54af4e2 | ||
|
42e0d608c8 | ||
|
2c35d63976 | ||
|
d1ca1e768f | ||
|
2255cc2ebc | ||
|
6512c12f40 | ||
|
fc8d428d1d | ||
|
e07613818d | ||
|
de59ae11bd | ||
|
026690c837 | ||
|
c223a72f5b | ||
|
c66cf83ef1 | ||
|
30cf9ac857 | ||
|
b99b9d5435 | ||
|
81b9ab2b6e | ||
|
78a60a9973 | ||
|
fca6f838d5 | ||
|
4a39eb7931 | ||
|
00ab5f0afb | ||
|
34dfd73aab | ||
|
9e0e12a468 | ||
|
1bdcb4f737 | ||
|
5e5ecdcf32 | ||
|
b316217394 | ||
|
d96e307e2c | ||
|
a7944bb3c5 | ||
|
2dc3885691 | ||
|
027ab98a3e | ||
|
1a5736a498 | ||
|
73f4c036c6 | ||
|
6cbadcf8e9 | ||
|
6a38f231b1 | ||
|
02d63daba5 | ||
|
99074b3c34 | ||
|
bb33609164 | ||
|
27832741e4 | ||
|
0cffdc9868 | ||
|
6055d44120 | ||
|
984305d483 | ||
|
7934624afc | ||
|
e7db5aa4f3 | ||
|
e922299a55 | ||
|
58cbc7a05f | ||
|
43648a2382 | ||
|
c1abaa3293 | ||
|
9f77879198 | ||
|
79279e5614 | ||
|
d100897b20 | ||
|
bfaaefaf0a | ||
|
520c6fa426 | ||
|
d95b520512 | ||
|
10f8637802 | ||
|
b327cc0f52 | ||
|
88acdaff90 | ||
|
d5039809de | ||
|
2746b73416 | ||
|
fdd1d20c5b | ||
|
e2b4670016 | ||
|
336adc6974 | ||
|
7c72ac52e1 | ||
|
d165bb2bb2 | ||
|
12dea02fab | ||
|
5181ee172b | ||
|
def0d9307e | ||
|
45e572388b | ||
|
4898de8d41 | ||
|
1aa2270d97 | ||
|
5abc9a8066 | ||
|
a8deb6cc74 | ||
|
87bcb46f43 | ||
|
3d904aac67 | ||
|
ace63fe83a | ||
|
33320fd758 | ||
|
be5b4b7702 | ||
|
5c55064c0f | ||
|
71ad8dcec0 | ||
|
09fd8bc521 | ||
|
ace0150fcb | ||
|
e627d3ce01 | ||
|
a65f981f55 | ||
|
dbebb3818d | ||
|
2027b74c5f | ||
|
5e921fdd08 | ||
|
6eda017719 | ||
|
9b9960c7b9 | ||
|
9df09e2464 | ||
|
5dacc58a4e | ||
|
fcb18e8d34 | ||
|
9af95a9461 | ||
|
bef662a6e1 | ||
|
04f24f32e2 | ||
|
65743882bb | ||
|
9e82b51eb5 | ||
|
a20c40ca90 | ||
|
745bdda1a3 | ||
|
3c7e538202 | ||
|
786419fee0 | ||
|
739651b917 | ||
|
e374469818 | ||
|
2ecd9672c2 | ||
|
68a4ad2e51 | ||
|
b2e2c27775 | ||
|
8e45d5e137 | ||
|
1ded7cd4f1 | ||
|
8bd2411a89 | ||
|
907fba7d0f | ||
|
bb5afc43b9 | ||
|
a243c9d685 | ||
|
829eeb2374 | ||
|
338de4ffa1 | ||
|
c7fbd6c64c | ||
|
95b7ae3146 | ||
|
ded48fd453 | ||
|
cbe2cf8a85 | ||
|
a12dc5c81b | ||
|
db062154d1 | ||
|
ac3a6426e8 | ||
|
f1f5b57254 | ||
|
3403e8af9b | ||
|
19286db952 | ||
|
40234e5b4a | ||
|
a9f046609c | ||
|
f2e2672e81 | ||
|
784f2674a9 | ||
|
93399165e7 | ||
|
7422485817 | ||
|
2ef19f31db | ||
|
8154209eab | ||
|
d56fb374a7 | ||
|
7bad1d2921 | ||
|
37dd494abd | ||
|
a9748e1b52 | ||
|
cc33101923 | ||
|
31fbbb52a8 | ||
|
d2c5665a30 | ||
|
06744ee7fb | ||
|
3e1db453ff | ||
|
ec76186c23 | ||
|
fcf975a65c | ||
|
e6d2c7db88 | ||
|
d012268953 | ||
|
70b797cb6d | ||
|
28d7cf38c8 | ||
|
6094fa7b6d | ||
|
8f3b7ee522 | ||
|
74f6fb7408 | ||
|
4ccb735282 | ||
|
b94631c84a | ||
|
2544e4fd65 | ||
|
7454a7a6f3 | ||
|
13e262b9cf | ||
|
b4db9d8b7d | ||
|
14ad5ced78 | ||
|
b2e592bb41 | ||
|
1a3281a959 | ||
|
6701c58a10 | ||
|
80fd0db2eb | ||
|
7ca8c5c16d | ||
|
3ed7cc5cab | ||
|
0987ae05a8 | ||
|
3154149d37 | ||
|
6f46109617 | ||
|
b0896408d2 | ||
|
243b478b99 | ||
|
fabbad2b2c | ||
|
1948ffe7bd | ||
|
67baee60f8 | ||
|
8f4c4715e2 | ||
|
3e7cbe6015 | ||
|
0053bde668 | ||
|
363dd31768 | ||
|
f841737adc | ||
|
9adaa7972e | ||
|
ec387f9bb7 | ||
|
aa657776fc | ||
|
f12632a1f2 | ||
|
4f8164dc43 | ||
|
88303d8855 | ||
|
4e8ddafa64 | ||
|
1ebe9d2bba | ||
|
fbae619725 | ||
|
8c5f4c3de7 | ||
|
154841157f | ||
|
6a20d06194 | ||
|
245e118016 | ||
|
fcc9d6749c | ||
|
9e091c5015 | ||
|
01247319c3 | ||
|
1d3d5f7e32 | ||
|
49f2cef5ac | ||
|
926d165321 | ||
|
86218445cd | ||
|
6e0f695699 | ||
|
7b9ff7776d | ||
|
e0f3f53d42 | ||
|
2e911ee709 | ||
|
43afed6654 | ||
|
0dda8328af | ||
|
48052fc3e4 | ||
|
5ac5fed513 | ||
|
60521e8167 | ||
|
510568d4f1 | ||
|
3e3ec3134d | ||
|
c22374893e | ||
|
013eaeeb07 | ||
|
b97b6867d8 | ||
|
87f31ec532 | ||
|
9b12695443 | ||
|
cbb40c1c2b | ||
|
b0e56fc27b | ||
|
d15532227d | ||
|
c3f98e95ad | ||
|
e92e99d6ea | ||
|
f6b67f6c98 | ||
|
108861b6ca | ||
|
80d93e8d75 | ||
|
1634cd53be | ||
|
577df3749d | ||
|
73c53b3da6 | ||
|
9af996a907 | ||
|
bd2e4a8076 | ||
|
ceaa6a592c | ||
|
b503fecccb | ||
|
4161055cc7 | ||
|
b0c9a3bbe1 | ||
|
436bdde461 | ||
|
01853064b0 | ||
|
c1ccb5af0f | ||
|
706f04ee27 | ||
|
549e35e972 | ||
|
1ed66966a8 | ||
|
326539f1f5 | ||
|
67322ba39f | ||
|
41fcc41bd1 | ||
|
7aacff62ca | ||
|
4566ddb037 | ||
|
957e6b1500 | ||
|
5945635d1d | ||
|
045fc0914b | ||
|
72442871aa | ||
|
bbd3c03969 | ||
|
a4405c3d39 | ||
|
0fe4f587d8 | ||
|
d3c714bd17 | ||
|
c399b7a7d5 | ||
|
b9234e94fb | ||
|
417bb87785 | ||
|
0233ae3134 | ||
|
eed0c5dd59 | ||
|
2b3b167095 | ||
|
5d91d19808 | ||
|
0f374ddee9 | ||
|
a65a9913cd | ||
|
1ead32c666 | ||
|
d1af9fc780 | ||
|
0f06737fb6 | ||
|
1676231532 | ||
|
b1caf697c8 | ||
|
51481065fe | ||
|
e367da710c | ||
|
f493d6524d | ||
|
e1b85da2a7 | ||
|
22c6548ed1 | ||
|
afb32c087d | ||
|
bbc1ed1c64 | ||
|
3a46f1a27a | ||
|
90cd364780 | ||
|
6795e6f078 | ||
|
cfb3404349 | ||
|
0212f3ee78 | ||
|
6b2995a4ee | ||
|
09e7ac54d4 | ||
|
f69009d4a8 | ||
|
206802ae33 | ||
|
91d4138fb8 | ||
|
cb455f951a | ||
|
5f25d20cd0 | ||
|
1f0e2cd910 | ||
|
1749d02701 | ||
|
55ace3179c | ||
|
7866d9ccb4 | ||
|
51f73d07fa | ||
|
63d84674ab | ||
|
14066997b2 | ||
|
28561e765a | ||
|
453fbbdc5d | ||
|
1e1e5ec10d | ||
|
2088b0e459 | ||
|
58400d9e01 | ||
|
ac9375f1d2 | ||
|
db061c9355 | ||
|
d5ce6c464b | ||
|
b06205bb7f | ||
|
f528a3e1de | ||
|
bddfdacfad | ||
|
d3cdd3f235 | ||
|
41ae45ea40 | ||
|
657e0895ea | ||
|
0ae2d8bab5 | ||
|
3e0bd1f02d | ||
|
b2592d1cc2 | ||
|
aa3524c3b2 | ||
|
35fcfb978d | ||
|
c68083cf03 | ||
|
39deb1a05f | ||
|
302d08e290 | ||
|
05489dd7f1 | ||
|
cfb5119efc | ||
|
5d53fa5635 | ||
|
38d2b70ba6 | ||
|
29d5db16c2 | ||
|
a8128c5772 | ||
|
55bd076602 | ||
|
53a08d00fd | ||
|
fccec66463 | ||
|
bc26e807cd | ||
|
46dc37fb20 | ||
|
ccbb8400ee | ||
|
5d3d8a5332 | ||
|
7a224fe08f | ||
|
e045f5f74b | ||
|
e5c07ff0c5 | ||
|
cdf0aa27e4 | ||
|
88998e6bb7 | ||
|
b885dfa606 | ||
|
407495c278 | ||
|
ea50a94355 | ||
|
cb3318972e | ||
|
c057ad7977 | ||
|
eb21718462 | ||
|
7836e10d8a | ||
|
946a31821d | ||
|
92a915f477 | ||
|
60b458dbfb | ||
|
8b13efc89a | ||
|
88b625fa15 | ||
|
2cf9c9b7df | ||
|
d179d6a1a2 | ||
|
08502c1eb6 | ||
|
384cd47416 | ||
|
3bdeb82097 | ||
|
f49ab3f919 | ||
|
42d5bdd3ab | ||
|
7228cbfe92 | ||
|
250c46d6a4 | ||
|
f394d7dba9 | ||
|
ca595cd8cf | ||
|
9ce71739f5 | ||
|
d69da38f7d | ||
|
50f69f734f | ||
|
fc9c6c5434 | ||
|
6e941be1e9 | ||
|
9f677150a4 | ||
|
11e273337f | ||
|
ec807120c3 | ||
|
a5654debeb | ||
|
0869c0d8b0 | ||
|
b456c3f953 | ||
|
8297d68166 | ||
|
18ce6797e0 | ||
|
c1009d440e | ||
|
89ee6fe6db | ||
|
38a12475bc | ||
|
9a800264a2 | ||
|
8ce390be3c | ||
|
cc93532f4f | ||
|
37cc40521c | ||
|
5ac7ff7084 | ||
|
e682b82ca8 | ||
|
7cd1fd0aaa | ||
|
8cd99c5a40 | ||
|
ad83312009 | ||
|
9e3b1fe333 | ||
|
c3f42995f9 | ||
|
3d3a02c892 | ||
|
06bec227ad | ||
|
5d7803323c | ||
|
4303f9a025 | ||
|
fe4c5434fa | ||
|
9325bb70c5 | ||
|
b164557165 | ||
|
424f984ea8 | ||
|
78c704e3d1 | ||
|
50f1a8fbd8 | ||
|
0f90b7b5da | ||
|
bec4384a5d | ||
|
f361efae5a | ||
|
76ca2116ab | ||
|
33d8646dc5 | ||
|
3cb5190bc6 | ||
|
5bba06bef8 | ||
|
dd3f672a35 | ||
|
25ef3b8445 | ||
|
7eb2d290d8 | ||
|
678762910b | ||
|
da28a542c7 | ||
|
92602d33ad | ||
|
03f04f4bb3 | ||
|
0d4dd5ff0d | ||
|
884864cc58 | ||
|
7c199d83be | ||
|
5b4c29c4bb | ||
|
f97ee80955 | ||
|
547322ae63 | ||
|
db74db622e | ||
|
57318c0041 | ||
|
4eb0767834 | ||
|
92bb7808ce | ||
|
abfe7d1613 | ||
|
6c72239365 | ||
|
8001daad8c | ||
|
73a38ab4f4 | ||
|
281c207921 | ||
|
ae531eef5f | ||
|
d8b11238e6 | ||
|
d36eb04ae8 | ||
|
b97ba35279 | ||
|
46efe92a72 | ||
|
9cc27c7d1b | ||
|
7d3396f9c5 | ||
|
918ef13714 | ||
|
9d12462893 | ||
|
ed44e16a95 | ||
|
11e2fc5bc4 | ||
|
3e88f820b8 | ||
|
163750f8c2 | ||
|
4aabc5d791 | ||
|
c9a7b9dcc1 | ||
|
98075b5653 | ||
|
57ae5be916 | ||
|
8caf62997f | ||
|
f8656ad376 | ||
|
29c6c2a2ad | ||
|
dadab94644 | ||
|
f2db67ef02 | ||
|
7ec232a470 | ||
|
dc3569392c | ||
|
11999cd407 | ||
|
f786f8a7f6 | ||
|
aab39e6ae0 | ||
|
31d3968649 | ||
|
72b8ef33d9 | ||
|
2cd0b01019 | ||
|
a6bc0db896 | ||
|
7cba95b523 | ||
|
1b976130ce | ||
|
e9babc5a94 | ||
|
c8d0ff846c | ||
|
db1e9769d0 | ||
|
4b038b07ed | ||
|
4c17c142f9 | ||
|
65b2fa13ac | ||
|
c375199daa | ||
|
805131cf1e | ||
|
6f64115561 | ||
|
0aadb789a5 | ||
|
26ee4d626c | ||
|
a8939d3eda | ||
|
048e48b03a | ||
|
c2f34baee0 | ||
|
8961b476ef | ||
|
58e08335b5 | ||
|
ea8fc1d93f | ||
|
2968dfb2ae | ||
|
24783107ba | ||
|
365c056b0f | ||
|
88a7d9cca8 | ||
|
d8cf9d54aa | ||
|
df746c5ff4 | ||
|
aa29526ae4 | ||
|
f0b5616aba | ||
|
2eca95df00 | ||
|
f560c2e66a | ||
|
5e19496e32 | ||
|
aeadaba005 | ||
|
8dfda9ffdd | ||
|
91992bb034 | ||
|
34a93857a0 | ||
|
fbda096aa9 | ||
|
24a26aef70 | ||
|
ec7f9d8a63 | ||
|
cc7dec7a99 | ||
|
46384ce80d | ||
|
5aeb626045 | ||
|
d2a27f1a48 | ||
|
f07c67202f | ||
|
3a3658708a | ||
|
f3c5d19246 | ||
|
c66d8f202a | ||
|
ec641c171d | ||
|
773d624365 | ||
|
25bd97a014 | ||
|
5dd9e28f72 | ||
|
cc1ef6f268 | ||
|
967e361da3 | ||
|
398097900c | ||
|
b86473f3c7 | ||
|
3d361c6b4a | ||
|
3346024ea7 | ||
|
2fecf6c80b | ||
|
183b4fb7ee | ||
|
0e2afc5dcb | ||
|
91aa716c07 | ||
|
9977626de0 | ||
|
8bb3fb5bb3 | ||
|
6d7adb277e | ||
|
fef1bd13b5 | ||
|
910bba9976 | ||
|
cd2d756717 | ||
|
0a47d89963 | ||
|
65e5b09cd1 | ||
|
6f3cee1a1e | ||
|
c43d4bbf71 | ||
|
b7337410aa | ||
|
10b7d7da3f | ||
|
97a8c6e5af | ||
|
e69d2bb54a | ||
|
ead8099109 | ||
|
9d455b2bca | ||
|
1e6e74878f | ||
|
cbcede3b63 | ||
|
98fd731485 | ||
|
9ca319b4ea | ||
|
ff8fabf49e | ||
|
1e00f68941 | ||
|
6c79edd3b2 | ||
|
b79bc6bab9 | ||
|
c59d886662 | ||
|
e39dce6159 | ||
|
620c66fb4c | ||
|
3af91d54cb | ||
|
1fe1bcff98 | ||
|
c58c12c5b3 | ||
|
1aeea39eb3 | ||
|
d3fbf020de | ||
|
8ce8bee76f | ||
|
dcf4eb2aaf | ||
|
88ff38eca6 | ||
|
bf0d90d079 | ||
|
c4d9ef9f83 | ||
|
37bce53683 | ||
|
05d50b62c9 | ||
|
eb2fb7f790 | ||
|
d280ccb3c4 | ||
|
a569815840 | ||
|
9e41c3093b | ||
|
9dbc9a8ad9 | ||
|
c940157814 | ||
|
4f19875a58 | ||
|
dcbadb2386 | ||
|
405a7b2037 | ||
|
e69ad24737 | ||
|
a31056a4ec | ||
|
d41dddddcd | ||
|
251ae50d3e | ||
|
4ccd2d4955 | ||
|
dfb79e0998 | ||
|
590055e2ba | ||
|
f388751a97 | ||
|
53136caaa4 | ||
|
dd20d8d6de | ||
|
a977957946 | ||
|
8974fcabe3 | ||
|
aff8e1e025 | ||
|
10d767c5ab | ||
|
77484dc69e | ||
|
185e2342d9 | ||
|
54f4727adc | ||
|
6e0f982163 | ||
|
43072ef80d | ||
|
7618e63f49 | ||
|
542255332d | ||
|
6d6e7e1468 | ||
|
0ff88d5c21 | ||
|
092e35bae3 | ||
|
ac82b2622c | ||
|
7197cb57cd | ||
|
030d66cb63 | ||
|
d414e6a7c4 | ||
|
30f9c94620 |
@@ -4,48 +4,44 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
resource_class: medium+
|
resource_class: medium+
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
environment:
|
environment:
|
||||||
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
||||||
- run:
|
# HACK(feuGeneA): commented out this hack as we're changing
|
||||||
# HACK(albrow): Without this, yarn commands will sometimes
|
# from a circleci-maintained container to a different
|
||||||
# fail with a "permission denied" error.
|
# container, and this hack may not apply anymore, as
|
||||||
name: Set npm path
|
# suggested by the non-existance of `/home/circleci/.bashrc`
|
||||||
command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
# when running the command below.
|
||||||
|
# - run:
|
||||||
|
# # HACK(albrow): Without this, yarn commands will sometimes
|
||||||
|
# # fail with a "permission denied" error.
|
||||||
|
# name: Set npm path
|
||||||
|
# command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||||
- run:
|
- run:
|
||||||
name: install-yarn
|
name: install-yarn
|
||||||
command: npm install --global yarn@1.9.4
|
command: npm install --global yarn@1.17.0
|
||||||
- run:
|
- run:
|
||||||
name: yarn
|
name: yarn
|
||||||
command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install
|
command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install
|
||||||
- setup_remote_docker
|
- setup_remote_docker
|
||||||
- run: yarn build:ci:no_website
|
- run: yarn build:ci
|
||||||
- run: yarn build:ts
|
- run: yarn build:ts
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: repo-{{ .Environment.CIRCLE_SHA1 }}
|
key: repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
paths:
|
paths:
|
||||||
- ~/repo
|
- ~/repo
|
||||||
- save_cache:
|
- store_artifacts:
|
||||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
path: ~/repo/packages/abi-gen/test-cli/output
|
||||||
paths:
|
- store_artifacts:
|
||||||
- ~/repo/packages/python-contract-wrappers/generated
|
path: ~/repo/packages/abi-gen-wrappers/generated_docs
|
||||||
build-website:
|
test-contracts-ganache:
|
||||||
resource_class: medium+
|
resource_class: medium+
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
working_directory: ~/repo
|
|
||||||
steps:
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
|
||||||
- run: cd packages/website && yarn build:prod
|
|
||||||
test-contracts-ganache:
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:9-browsers
|
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -54,7 +50,7 @@ jobs:
|
|||||||
- run: yarn wsrun test:circleci @0x/contracts-multisig @0x/contracts-utils @0x/contracts-exchange-libs @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-extensions @0x/contracts-asset-proxy @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-coordinator @0x/contracts-dev-utils
|
- run: yarn wsrun test:circleci @0x/contracts-multisig @0x/contracts-utils @0x/contracts-exchange-libs @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-extensions @0x/contracts-asset-proxy @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-coordinator @0x/contracts-dev-utils
|
||||||
test-contracts-geth:
|
test-contracts-geth:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
- image: 0xorg/devnet
|
- image: 0xorg/devnet
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
@@ -67,7 +63,7 @@ jobs:
|
|||||||
test-publish:
|
test-publish:
|
||||||
resource_class: medium+
|
resource_class: medium+
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
- image: 0xorg/verdaccio
|
- image: 0xorg/verdaccio
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
@@ -77,7 +73,7 @@ jobs:
|
|||||||
- run: yarn test:publish:circleci
|
- run: yarn test:publish:circleci
|
||||||
test-doc-generation:
|
test-doc-generation:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -86,7 +82,7 @@ jobs:
|
|||||||
- run: yarn test:generate_docs:circleci
|
- run: yarn test:generate_docs:circleci
|
||||||
test-rest:
|
test-rest:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -102,9 +98,7 @@ jobs:
|
|||||||
- run: yarn wsrun test:circleci @0x/contract-wrappers
|
- run: yarn wsrun test:circleci @0x/contract-wrappers
|
||||||
- run: yarn wsrun test:circleci @0x/dev-utils
|
- run: yarn wsrun test:circleci @0x/dev-utils
|
||||||
- run: yarn wsrun test:circleci @0x/json-schemas
|
- run: yarn wsrun test:circleci @0x/json-schemas
|
||||||
- run: yarn wsrun test:circleci @0x/metacoin
|
|
||||||
- run: yarn wsrun test:circleci @0x/order-utils
|
- run: yarn wsrun test:circleci @0x/order-utils
|
||||||
- run: yarn wsrun test:circleci @0x/order-watcher
|
|
||||||
- run: yarn wsrun test:circleci @0x/sol-compiler
|
- run: yarn wsrun test:circleci @0x/sol-compiler
|
||||||
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
|
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
|
||||||
- run: yarn wsrun test:circleci @0x/sol-doc
|
- run: yarn wsrun test:circleci @0x/sol-doc
|
||||||
@@ -144,18 +138,10 @@ jobs:
|
|||||||
key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
paths:
|
paths:
|
||||||
- ~/repo/packages/json-schemas/coverage/lcov.info
|
- ~/repo/packages/json-schemas/coverage/lcov.info
|
||||||
- save_cache:
|
|
||||||
key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
|
|
||||||
paths:
|
|
||||||
- ~/repo/packages/metacoin/coverage/lcov.info
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
paths:
|
paths:
|
||||||
- ~/repo/packages/order-utils/coverage/lcov.info
|
- ~/repo/packages/order-utils/coverage/lcov.info
|
||||||
- save_cache:
|
|
||||||
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
|
||||||
paths:
|
|
||||||
- ~/repo/packages/order-watcher/coverage/lcov.info
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
paths:
|
paths:
|
||||||
@@ -179,22 +165,22 @@ jobs:
|
|||||||
test-python:
|
test-python:
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
- image: 0xorg/ganache-cli:2.2.2
|
- image: 0xorg/ganache-cli:2.2.2
|
||||||
- image: 0xorg/launch-kit-ci
|
- image: 0xorg/launch-kit-backend:74bcc39
|
||||||
environment:
|
environment:
|
||||||
RPC_URL: http://localhost:8545
|
RPC_URL: http://localhost:8545
|
||||||
NETWORK_ID: 50
|
NETWORK_ID: 50
|
||||||
WHITELIST_ALL_TOKENS: True
|
WHITELIST_ALL_TOKENS: True
|
||||||
command: bash -c "until curl -sfd'{\"method\":\"net_listening\"}' http://localhost:8545 | grep true; do continue; done; forever ts/lib/index.js"
|
command: |
|
||||||
|
sh -c "until printf 'POST /\r\nContent-Length: 26\r\n\r\n{\"method\":\"net_listening\"}' | nc localhost 8545 | grep true; do continue; done; node_modules/.bin/forever ts/lib/index.js"
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
|
||||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
keys:
|
||||||
|
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
cd python-packages
|
cd python-packages
|
||||||
@@ -209,7 +195,8 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
cd python-packages
|
cd python-packages
|
||||||
./cmd_pkgs_in_dep_order.py coverage run setup.py test
|
./parallel_without_sra_client coverage run setup.py test
|
||||||
|
./build_docs
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
paths:
|
paths:
|
||||||
@@ -234,14 +221,28 @@ jobs:
|
|||||||
key: coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }}
|
key: coverage-python-sra-client-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
paths:
|
paths:
|
||||||
- ~/repo/python-packages/sra_client/.coverage
|
- ~/repo/python-packages/sra_client/.coverage
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/*/__init__.py
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/contract_addresses/build
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/contract_artifacts/build
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/contract_wrappers/build
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/json_schemas/build
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/middlewares/build
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/order_utils/build
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/repo/python-packages/sra_client/build
|
||||||
test-rest-python:
|
test-rest-python:
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
|
||||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- run:
|
- run:
|
||||||
@@ -265,15 +266,14 @@ jobs:
|
|||||||
static-tests-python:
|
static-tests-python:
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
|
||||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
keys:
|
||||||
|
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
python -m ensurepip
|
python -m ensurepip
|
||||||
@@ -282,9 +282,10 @@ jobs:
|
|||||||
./install
|
./install
|
||||||
./lint
|
./lint
|
||||||
static-tests:
|
static-tests:
|
||||||
|
resource_class: large
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
@@ -292,11 +293,12 @@ jobs:
|
|||||||
- run: yarn lerna run lint
|
- run: yarn lerna run lint
|
||||||
- run: yarn prettier:ci
|
- run: yarn prettier:ci
|
||||||
- run: yarn deps_versions:ci
|
- run: yarn deps_versions:ci
|
||||||
|
- run: yarn diff_md_docs:ci
|
||||||
- run: cd packages/0x.js && yarn build:umd:prod
|
- run: cd packages/0x.js && yarn build:umd:prod
|
||||||
- run: yarn bundlewatch
|
- run: yarn bundlewatch
|
||||||
submit-coverage:
|
submit-coverage:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:9-browsers
|
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -326,15 +328,9 @@ jobs:
|
|||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
- coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
@@ -377,9 +373,6 @@ workflows:
|
|||||||
main:
|
main:
|
||||||
jobs:
|
jobs:
|
||||||
- build
|
- build
|
||||||
- build-website:
|
|
||||||
requires:
|
|
||||||
- build
|
|
||||||
- test-contracts-ganache:
|
- test-contracts-ganache:
|
||||||
requires:
|
requires:
|
||||||
- build
|
- build
|
||||||
|
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -3,5 +3,6 @@
|
|||||||
# Automatically collapse generated files in GitHub.
|
# Automatically collapse generated files in GitHub.
|
||||||
*.svg linguist-generated=true
|
*.svg linguist-generated=true
|
||||||
packages/contract-artifacts/artifacts/*json linguist-generated=true
|
packages/contract-artifacts/artifacts/*json linguist-generated=true
|
||||||
packages/abi-gen-wrappers/src/generated-wrappers/*.ts liguist-generated=true
|
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||||
|
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||||
|
|
||||||
|
6
.github/autolabeler.yml
vendored
6
.github/autolabeler.yml
vendored
@@ -13,7 +13,6 @@ contracts: ['contracts']
|
|||||||
@0x/instant: ['packages/instant']
|
@0x/instant: ['packages/instant']
|
||||||
@0x/abi-gen-templates: ['packages/abi-gen-templates']
|
@0x/abi-gen-templates: ['packages/abi-gen-templates']
|
||||||
@0x/abi-gen: ['packages/abi-gen']
|
@0x/abi-gen: ['packages/abi-gen']
|
||||||
@0x/website: ['packages/website']
|
|
||||||
@0x/sol-coverage: ['packages/sol-coverage']
|
@0x/sol-coverage: ['packages/sol-coverage']
|
||||||
@0x/sol-profiler: ['packages/sol-profiler']
|
@0x/sol-profiler: ['packages/sol-profiler']
|
||||||
@0x/sol-trace: ['packages/sol-trace']
|
@0x/sol-trace: ['packages/sol-trace']
|
||||||
@@ -21,16 +20,12 @@ contracts: ['contracts']
|
|||||||
@0x/utils: ['packages/utils']
|
@0x/utils: ['packages/utils']
|
||||||
@0x/tslint-config: ['packages/tslint-config']
|
@0x/tslint-config: ['packages/tslint-config']
|
||||||
@0x/asset-buyer: ['packages/asset-buyer']
|
@0x/asset-buyer: ['packages/asset-buyer']
|
||||||
@0x/order-watcher: ['packages/order-watcher']
|
|
||||||
@0x/react-docs: ['packages/react-docs']
|
|
||||||
@0x/order-utils: ['packages/order-utils']
|
@0x/order-utils: ['packages/order-utils']
|
||||||
@0x/react-shared: ['packages/react-shared']
|
|
||||||
@0x/assert: ['packages/assert']
|
@0x/assert: ['packages/assert']
|
||||||
@0x/base-contract: ['packages/base-contract']
|
@0x/base-contract: ['packages/base-contract']
|
||||||
@0x/typescript-typings: ['packages/typescript-typings']
|
@0x/typescript-typings: ['packages/typescript-typings']
|
||||||
0x.js: ['packages/0x.js']
|
0x.js: ['packages/0x.js']
|
||||||
@0x/abi-gen-wrappers: ['packages/abi-gen-wrappers']
|
@0x/abi-gen-wrappers: ['packages/abi-gen-wrappers']
|
||||||
@0x/metacoin: ['packages/metacoin']
|
|
||||||
@0x/contract-artifacts: ['packages/contract-artifacts']
|
@0x/contract-artifacts: ['packages/contract-artifacts']
|
||||||
@0x/dev-utils: ['packages/dev-utils']
|
@0x/dev-utils: ['packages/dev-utils']
|
||||||
@0x/contract-wrappers: ['packages/contract-wrappers']
|
@0x/contract-wrappers: ['packages/contract-wrappers']
|
||||||
@@ -38,6 +33,5 @@ contracts: ['contracts']
|
|||||||
@0x/ethereum-types: ['ethereum-types']
|
@0x/ethereum-types: ['ethereum-types']
|
||||||
@0x/connect: ['packages/connect']
|
@0x/connect: ['packages/connect']
|
||||||
@0x/fill-scenarios: ['packages/fill-scenarios']
|
@0x/fill-scenarios: ['packages/fill-scenarios']
|
||||||
@0x/dev-tools-pages: ['packages/dev-tools-pages']
|
|
||||||
@0x/testnet-faucets: ['packages/testnet-faucets']
|
@0x/testnet-faucets: ['packages/testnet-faucets']
|
||||||
@0x/monorepo-scripts: ['packages/monorepo-scripts']
|
@0x/monorepo-scripts: ['packages/monorepo-scripts']
|
||||||
|
46
.gitignore
vendored
46
.gitignore
vendored
@@ -40,9 +40,12 @@ build/Release
|
|||||||
node_modules/
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
|
|
||||||
# Typescript v1 declaration files
|
# TypeScript v1 declaration files
|
||||||
typings/
|
typings/
|
||||||
|
|
||||||
|
# NVM config
|
||||||
|
.nvmrc
|
||||||
|
|
||||||
# Optional npm cache directory
|
# Optional npm cache directory
|
||||||
.npm
|
.npm
|
||||||
.npmrc
|
.npmrc
|
||||||
@@ -75,10 +78,6 @@ TODO.md
|
|||||||
# VSCode file
|
# VSCode file
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
packages/website/public/bundle*
|
|
||||||
packages/dev-tools-pages/public/bundle*
|
|
||||||
packages/react-docs/example/public/bundle*
|
|
||||||
|
|
||||||
# server cli
|
# server cli
|
||||||
packages/testnet-faucets/server/
|
packages/testnet-faucets/server/
|
||||||
|
|
||||||
@@ -96,11 +95,9 @@ contracts/extensions/generated-artifacts/
|
|||||||
contracts/exchange-forwarder/generated-artifacts/
|
contracts/exchange-forwarder/generated-artifacts/
|
||||||
contracts/dev-utils/generated-artifacts/
|
contracts/dev-utils/generated-artifacts/
|
||||||
packages/sol-tracing-utils/test/fixtures/artifacts/
|
packages/sol-tracing-utils/test/fixtures/artifacts/
|
||||||
packages/metacoin/artifacts/
|
|
||||||
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
||||||
|
|
||||||
# generated contract wrappers
|
# generated contract wrappers
|
||||||
packages/abi-gen-wrappers/src/generated-wrappers/
|
|
||||||
packages/python-contract-wrappers/generated/
|
packages/python-contract-wrappers/generated/
|
||||||
contracts/coordinator/generated-wrappers/
|
contracts/coordinator/generated-wrappers/
|
||||||
contracts/exchange/generated-wrappers/
|
contracts/exchange/generated-wrappers/
|
||||||
@@ -114,17 +111,30 @@ contracts/erc1155/generated-wrappers/
|
|||||||
contracts/extensions/generated-wrappers/
|
contracts/extensions/generated-wrappers/
|
||||||
contracts/exchange-forwarder/generated-wrappers/
|
contracts/exchange-forwarder/generated-wrappers/
|
||||||
contracts/dev-utils/generated-wrappers/
|
contracts/dev-utils/generated-wrappers/
|
||||||
packages/metacoin/src/contract_wrappers
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
|
||||||
# cli test output
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/asset_proxy_owner/__init__.py
|
||||||
packages/abi-gen/test-cli/output
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator_registry/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc20_token/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc721_token/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dutch_auction/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_proxy/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_proxy/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_token/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/eth_balance_checker/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/forwarder/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_asset_proxy/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_validator/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_wallet/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/multi_asset_proxy/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/order_validator/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/weth9/__init__.py
|
||||||
|
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/zrx_token/__init__.py
|
||||||
|
|
||||||
# solc-bin in sol-compiler
|
# solc-bin in sol-compiler
|
||||||
packages/sol-compiler/solc_bin/
|
packages/sol-compiler/solc_bin/
|
||||||
|
|
||||||
# Monorepo scripts
|
|
||||||
packages/*/scripts/
|
|
||||||
|
|
||||||
# python stuff
|
# python stuff
|
||||||
.eggs
|
.eggs
|
||||||
.mypy_cache
|
.mypy_cache
|
||||||
@@ -134,3 +144,11 @@ python-packages/*/dist
|
|||||||
__pycache__
|
__pycache__
|
||||||
python-packages/*/src/*.egg-info
|
python-packages/*/src/*.egg-info
|
||||||
python-packages/*/.coverage
|
python-packages/*/.coverage
|
||||||
|
|
||||||
|
# python keeps package-local copies of json schemas
|
||||||
|
python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||||
|
|
||||||
|
# Doc README copy
|
||||||
|
packages/*/docs/README.md
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
@@ -27,13 +27,14 @@ lib
|
|||||||
/packages/abi-gen/test-cli/output
|
/packages/abi-gen/test-cli/output
|
||||||
/packages/json-schemas/schemas
|
/packages/json-schemas/schemas
|
||||||
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||||
/packages/metacoin/src/contract_wrappers
|
|
||||||
/packages/metacoin/artifacts
|
|
||||||
/packages/sra-spec/public/
|
/packages/sra-spec/public/
|
||||||
/packages/dev-tools-pages/ts/**/data.json
|
|
||||||
package.json
|
package.json
|
||||||
scripts/postpublish_utils.js
|
scripts/postpublish_utils.js
|
||||||
packages/sol-coverage/test/fixtures/artifacts
|
packages/sol-coverage/test/fixtures/artifacts
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
.mypy_cache
|
.mypy_cache
|
||||||
.tox
|
.tox
|
||||||
|
packages/abi-gen/test-cli/fixtures/artifacts/AbiGenDummy.json
|
||||||
|
packages/abi-gen/test-cli/fixtures/artifacts/LibDummy.json
|
||||||
|
packages/abi-gen/test-cli/fixtures/artifacts/TestLibDummy.json
|
||||||
|
packages/*/docs
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
# Website
|
# Website
|
||||||
packages/asset-buyer/ @BMillman19 @fragosti @steveklebanoff
|
packages/asset-buyer/ @BMillman19 @fragosti @steveklebanoff
|
||||||
packages/instant/ @BMillman19 @fragosti @steveklebanoff
|
packages/instant/ @BMillman19 @fragosti @steveklebanoff
|
||||||
packages/website/ @BMillman19 @fragosti @fabioberger @steveklebanoff
|
|
||||||
|
|
||||||
# Dev tools & setup
|
# Dev tools & setup
|
||||||
.circleci/ @LogvinovLeon
|
.circleci/ @LogvinovLeon
|
||||||
@@ -20,7 +19,6 @@ packages/contract-artifacts/ @albrow
|
|||||||
packages/dev-utils/ @LogvinovLeon @fabioberger
|
packages/dev-utils/ @LogvinovLeon @fabioberger
|
||||||
packages/devnet/ @albrow
|
packages/devnet/ @albrow
|
||||||
packages/ethereum-types/ @LogvinovLeon
|
packages/ethereum-types/ @LogvinovLeon
|
||||||
packages/metacoin/ @LogvinovLeon
|
|
||||||
packages/monorepo-scripts/ @fabioberger
|
packages/monorepo-scripts/ @fabioberger
|
||||||
packages/order-utils/ @fabioberger @LogvinovLeon
|
packages/order-utils/ @fabioberger @LogvinovLeon
|
||||||
packages/python-contract-wrappers/ @feuGeneA
|
packages/python-contract-wrappers/ @feuGeneA
|
||||||
|
@@ -29,9 +29,9 @@ ALL PRs should be opened against `development`.
|
|||||||
|
|
||||||
Branch names should be prefixed with `fix`, `feature` or `refactor`.
|
Branch names should be prefixed with `fix`, `feature` or `refactor`.
|
||||||
|
|
||||||
- e.g `fix/broken-wiki-link`
|
- e.g `fix/missing-import`
|
||||||
- If the PR only edits a single package, add it's name too
|
- If the PR only edits a single package, add it's name too
|
||||||
- e.g `fix/website/broken-wiki-link`
|
- e.g `fix/subproviders/missing-import`
|
||||||
|
|
||||||
### CHANGELOGs
|
### CHANGELOGs
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ If an entry without a `timestamp` already exists, this means other changes have
|
|||||||
|
|
||||||
### Development Tooling
|
### Development Tooling
|
||||||
|
|
||||||
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in Typescript and it offers amazing support for the language.
|
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in TypeScript and it offers amazing support for the language.
|
||||||
|
|
||||||
#### Linter
|
#### Linter
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ A few of our coding conventions are not yet enforced by the linter/auto-formatte
|
|||||||
1. Do not import from a project's `index.ts` (e.g import { Token } from '../src';). Always import from the source file itself.
|
1. Do not import from a project's `index.ts` (e.g import { Token } from '../src';). Always import from the source file itself.
|
||||||
1. Generic error variables should be named `err` instead of `e` or `error`.
|
1. Generic error variables should be named `err` instead of `e` or `error`.
|
||||||
1. If you _must_ cast a variable to any - try to type it back as fast as possible. (e.g., `const cw = ((zeroEx as any)._contractWrappers as ContractWrappers);`). This ensures subsequent code is type-safe.
|
1. If you _must_ cast a variable to any - try to type it back as fast as possible. (e.g., `const cw = ((zeroEx as any)._contractWrappers as ContractWrappers);`). This ensures subsequent code is type-safe.
|
||||||
1. Our enum conventions coincide with the recommended Typescript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
|
1. Our enum conventions coincide with the recommended TypeScript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
|
||||||
1. All public, exported methods/functions/classes must have associated Javadoc-style comments.
|
1. All public, exported methods/functions/classes must have associated Javadoc-style comments.
|
||||||
|
|
||||||
### Fix `submit-coverage` CI failure
|
### Fix `submit-coverage` CI failure
|
||||||
|
49
README.md
49
README.md
@@ -6,21 +6,16 @@
|
|||||||
|
|
||||||
This repository is a monorepo including the 0x protocol smart contracts and numerous developer tools. Each public sub-package is independently published to NPM.
|
This repository is a monorepo including the 0x protocol smart contracts and numerous developer tools. Each public sub-package is independently published to NPM.
|
||||||
|
|
||||||
If you're developing on 0x now or are interested in using 0x infrastructure in the future, please join our [developer mailing list][dev-mailing-list-url] for updates.
|
[website-url]: https://0x.org
|
||||||
|
|
||||||
[website-url]: https://0xproject.com
|
|
||||||
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
|
|
||||||
[dev-mailing-list-url]: http://eepurl.com/dx4cPf
|
|
||||||
|
|
||||||
[](https://circleci.com/gh/0xProject/0x-monorepo)
|
[](https://circleci.com/gh/0xProject/0x-monorepo)
|
||||||
[](https://coveralls.io/github/0xProject/0x-monorepo?branch=development)
|
[](https://coveralls.io/github/0xProject/0x-monorepo?branch=development)
|
||||||
[](https://chat.0xproject.com)
|
[](https://discordapp.com/invite/d3FTX3M)
|
||||||
[](https://gitter.im/0xProject/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
[](https://opensource.org/licenses/Apache-2.0)
|
[](https://opensource.org/licenses/Apache-2.0)
|
||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
Visit our [developer portal](https://0xproject.com/docs/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
|
Visit our [developer portal](https://0x.org/docs/tools/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
|
||||||
|
|
||||||
### Python Packages
|
### Python Packages
|
||||||
|
|
||||||
@@ -28,6 +23,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
|
|||||||
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||||
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network |
|
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network |
|
||||||
| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
|
| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
|
||||||
|
| [`0x-contract-wrappers`](/python-packages/contract_wrappers) | [](https://pypi.org/project/0x-contract-wrappers/) | 0x smart contract wrappers |
|
||||||
| [`0x-json-schemas`](/python-packages/json_schemas) | [](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
|
| [`0x-json-schemas`](/python-packages/json_schemas) | [](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
|
||||||
| [`0x-order-utils`](/python-packages/order_utils) | [](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
| [`0x-order-utils`](/python-packages/order_utils) | [](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||||
| [`0x-sra-client`](/python-packages/sra_client) | [](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
|
| [`0x-sra-client`](/python-packages/sra_client) | [](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
|
||||||
@@ -47,12 +43,12 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
|||||||
| [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [](https://www.npmjs.com/package/@0x/contracts-exchange-libs) | Protocol specific libraries used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract |
|
| [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [](https://www.npmjs.com/package/@0x/contracts-exchange-libs) | Protocol specific libraries used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract |
|
||||||
| [`@0x/contracts-extensions`](/contracts/extensions) | [](https://www.npmjs.com/package/@0x/contracts-extensions) | Contracts that interact with and extend the functionality of the core protocol |
|
| [`@0x/contracts-extensions`](/contracts/extensions) | [](https://www.npmjs.com/package/@0x/contracts-extensions) | Contracts that interact with and extend the functionality of the core protocol |
|
||||||
| [`@0x/contracts-multisig`](/contracts/multisig) | [](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol |
|
| [`@0x/contracts-multisig`](/contracts/multisig) | [](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol |
|
||||||
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts |
|
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [](https://www.npmjs.com/package/@0x/contracts-test-utils) | TypeScript/Javascript shared utilities used for testing contracts |
|
||||||
| [`@0x/contracts-utils`](/contracts/utils) | [](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts |
|
| [`@0x/contracts-utils`](/contracts/utils) | [](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts |
|
||||||
| [`@0x/contracts-coordinator`](/contracts/coordinator) | [](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator |
|
| [`@0x/contracts-coordinator`](/contracts/coordinator) | [](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator |
|
||||||
| [`@0x/contracts-dev-utils`](/contracts/dev-utils) | [](https://www.npmjs.com/package/@0x/contracts-dev-utils) | A contract contains utility functions for developers (such as validating many orders using a single eth_call) |
|
| [`@0x/contracts-dev-utils`](/contracts/dev-utils) | [](https://www.npmjs.com/package/@0x/contracts-dev-utils) | A contract contains utility functions for developers (such as validating many orders using a single eth_call) |
|
||||||
|
|
||||||
### Typescript/Javascript Packages
|
### TypeScript/Javascript Packages
|
||||||
|
|
||||||
#### 0x-specific packages
|
#### 0x-specific packages
|
||||||
|
|
||||||
@@ -62,14 +58,14 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
|||||||
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
|
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
|
||||||
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
|
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
|
||||||
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
|
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas | |
|
||||||
| [`@0x/order-watcher`](/packages/order-watcher) | [](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
|
|
||||||
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
|
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
|
||||||
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
||||||
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
|
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
|
||||||
| [`@0x/sra-spec`](/packages/sra-spec) | [](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the Standard Relayer API |
|
| [`@0x/sra-spec`](/packages/sra-spec) | [](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the Standard Relayer API |
|
||||||
| [`@0x/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0x/connect) | An HTTP/WS client for interacting with the Standard Relayer API |
|
| [`@0x/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0x/connect) | An HTTP/WS client for interacting with the Standard Relayer API |
|
||||||
| [`@0x/asset-buyer`](/packages/asset-buyer) | [](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
|
| [`@0x/asset-buyer`](/packages/asset-buyer) | [](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
|
||||||
|
| [`@0x/asset-swapper`](/packages/asset-swapper) | [](https://www.npmjs.com/package/@0x/asset-swapper) | Convenience package for discovering and performing swaps for any ERC20 Assets |
|
||||||
|
|
||||||
#### Ethereum tooling
|
#### Ethereum tooling
|
||||||
|
|
||||||
@@ -86,19 +82,17 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
|||||||
|
|
||||||
#### Utilities
|
#### Utilities
|
||||||
|
|
||||||
| Package | Version | Description |
|
| Package | Version | Description |
|
||||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
|
||||||
| [`@0x/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
| [`@0x/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||||
| [`@0x/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
|
| [`@0x/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
|
||||||
| [`@0x/types`](/packages/types) | [](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
|
| [`@0x/types`](/packages/types) | [](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
|
||||||
| [`@0x/typescript-typings`](/packages/typescript-typings) | [](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
|
| [`@0x/typescript-typings`](/packages/typescript-typings) | [](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
|
||||||
| [`@0x/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
|
| [`@0x/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
|
||||||
| [`@0x/react-docs`](/packages/react-docs) | [](https://www.npmjs.com/package/@0x/react-docs) | React documentation component for rendering TypeDoc & sol-doc generated JSON |
|
| [`@0x/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
|
||||||
| [`@0x/react-shared`](/packages/react-shared) | [](https://www.npmjs.com/package/@0x/react-shared) | 0x shared react components |
|
| [`@0x/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
||||||
| [`@0x/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
|
| [`@0x/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
|
||||||
| [`@0x/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
|
||||||
| [`@0x/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
|
|
||||||
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
|
|
||||||
|
|
||||||
#### Private Packages
|
#### Private Packages
|
||||||
|
|
||||||
@@ -106,11 +100,10 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
|||||||
| -------------------------------------------------- | -------------------------------------------------------------------------------- |
|
| -------------------------------------------------- | -------------------------------------------------------------------------------- |
|
||||||
| [`@0x/instant`](/packages/instant) | A free and flexible way to offer simple crypto purchasing in any app or website. |
|
| [`@0x/instant`](/packages/instant) | A free and flexible way to offer simple crypto purchasing in any app or website. |
|
||||||
| [`@0x/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
|
| [`@0x/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
|
||||||
| [`@0x/website`](/packages/website) | 0x website |
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Node version >= 6.12 is required.
|
Node version 6.x or 8.x is required.
|
||||||
|
|
||||||
Most of the packages require additional typings for external dependencies.
|
Most of the packages require additional typings for external dependencies.
|
||||||
You can include those by prepending the `@0x/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
|
You can include those by prepending the `@0x/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
|
||||||
@@ -139,6 +132,8 @@ Then install dependencies
|
|||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You will also need to have Python 3 installed, in order to build and run the tests of `abi-gen`'s command-line interface, which is integrated with the yarn build, yarn test, and yarn lint commands described below. More specifically, your local pip should resolve to the Python 3 version of pip, not a Python 2.x version.
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
To build all packages:
|
To build all packages:
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "2.2.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "2.2.7",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "2.2.6",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "2.2.5",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "2.2.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564607468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "2.2.3",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "2.2.2",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v2.2.8 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.7 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.6 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.5 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.4 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v2.2.3 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.2 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v2.2.1 - _July 13, 2019_
|
## v2.2.1 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## AssetProxy
|
## AssetProxy
|
||||||
|
|
||||||
This package contains the implementations of all of the [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts available within the 0x protocol. These contracts are responsible for decoding the `assetData` sent to them and performing the actual transfer of assets. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains the implementations of all of the [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts available within the 0x protocol. These contracts are responsible for decoding the `assetData` sent to them and performing the actual transfer of assets. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-asset-proxy --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -18,349 +18,71 @@
|
|||||||
|
|
||||||
pragma solidity ^0.5.9;
|
pragma solidity ^0.5.9;
|
||||||
|
|
||||||
|
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||||
|
import "@0x/contracts-utils/contracts/src/SafeMath.sol";
|
||||||
|
import "@0x/contracts-erc1155/contracts/src/interfaces/IERC1155.sol";
|
||||||
import "./MixinAuthorizable.sol";
|
import "./MixinAuthorizable.sol";
|
||||||
|
import "./interfaces/IAssetProxy.sol";
|
||||||
|
|
||||||
|
|
||||||
contract ERC1155Proxy is
|
contract ERC1155Proxy is
|
||||||
MixinAuthorizable
|
MixinAuthorizable,
|
||||||
|
SafeMath,
|
||||||
|
IAssetProxy
|
||||||
{
|
{
|
||||||
|
using LibBytes for bytes;
|
||||||
|
|
||||||
// Id of this proxy.
|
// Id of this proxy.
|
||||||
bytes4 constant internal PROXY_ID = bytes4(keccak256("ERC1155Assets(address,uint256[],uint256[],bytes)"));
|
bytes4 constant internal PROXY_ID = bytes4(keccak256("ERC1155Assets(address,uint256[],uint256[],bytes)"));
|
||||||
|
|
||||||
// solhint-disable-next-line payable-fallback
|
/// @dev Transfers batch of ERC1155 assets. Either succeeds or throws.
|
||||||
function ()
|
/// @param assetData Byte array encoded with ERC1155 token address, array of ids, array of values, and callback data.
|
||||||
|
/// @param from Address to transfer assets from.
|
||||||
|
/// @param to Address to transfer assets to.
|
||||||
|
/// @param amount Amount that will be multiplied with each element of `assetData.values` to scale the
|
||||||
|
/// values that will be transferred.
|
||||||
|
function transferFrom(
|
||||||
|
bytes calldata assetData,
|
||||||
|
address from,
|
||||||
|
address to,
|
||||||
|
uint256 amount
|
||||||
|
)
|
||||||
external
|
external
|
||||||
|
onlyAuthorized
|
||||||
{
|
{
|
||||||
// Input calldata to this function is encoded as follows:
|
// Decode params from `assetData`
|
||||||
// -- TABLE #1 --
|
// solhint-disable indent
|
||||||
// | Area | Offset (**) | Length | Contents |
|
(
|
||||||
// |----------|-------------|-------------|---------------------------------|
|
address erc1155TokenAddress,
|
||||||
// | Header | 0 | 4 | function selector |
|
uint256[] memory ids,
|
||||||
// | Params | | 4 * 32 | function parameters: |
|
uint256[] memory values,
|
||||||
// | | 4 | | 1. offset to assetData (*) |
|
bytes memory data
|
||||||
// | | 36 | | 2. from |
|
) = abi.decode(
|
||||||
// | | 68 | | 3. to |
|
assetData.sliceDestructive(4, assetData.length),
|
||||||
// | | 100 | | 4. amount |
|
(address, uint256[], uint256[], bytes)
|
||||||
// | Data | | | assetData: |
|
);
|
||||||
// | | 132 | 32 | assetData Length |
|
// solhint-enable indent
|
||||||
// | | 164 | (see below) | assetData Contents |
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Asset data is encoded as follows:
|
|
||||||
// -- TABLE #2 --
|
|
||||||
// | Area | Offset | Length | Contents |
|
|
||||||
// |----------|-------------|---------|-------------------------------------|
|
|
||||||
// | Header | 0 | 4 | assetProxyId |
|
|
||||||
// | Params | | 4 * 32 | function parameters: |
|
|
||||||
// | | 4 | | 1. address of ERC1155 contract |
|
|
||||||
// | | 36 | | 2. offset to ids (*) |
|
|
||||||
// | | 68 | | 3. offset to values (*) |
|
|
||||||
// | | 100 | | 4. offset to data (*) |
|
|
||||||
// | Data | | | ids: |
|
|
||||||
// | | 132 | 32 | 1. ids Length |
|
|
||||||
// | | 164 | a | 2. ids Contents |
|
|
||||||
// | | | | values: |
|
|
||||||
// | | 164 + a | 32 | 1. values Length |
|
|
||||||
// | | 196 + a | b | 2. values Contents |
|
|
||||||
// | | | | data: |
|
|
||||||
// | | 196 + a + b | 32 | 1. data Length |
|
|
||||||
// | | 228 + a + b | c | 2. data Contents |
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Calldata for target ERC155 asset is encoded for safeBatchTransferFrom:
|
|
||||||
// -- TABLE #3 --
|
|
||||||
// | Area | Offset (**) | Length | Contents |
|
|
||||||
// |----------|-------------|---------|-------------------------------------|
|
|
||||||
// | Header | 0 | 4 | safeBatchTransferFrom selector |
|
|
||||||
// | Params | | 5 * 32 | function parameters: |
|
|
||||||
// | | 4 | | 1. from address |
|
|
||||||
// | | 36 | | 2. to address |
|
|
||||||
// | | 68 | | 3. offset to ids (*) |
|
|
||||||
// | | 100 | | 4. offset to values (*) |
|
|
||||||
// | | 132 | | 5. offset to data (*) |
|
|
||||||
// | Data | | | ids: |
|
|
||||||
// | | 164 | 32 | 1. ids Length |
|
|
||||||
// | | 196 | a | 2. ids Contents |
|
|
||||||
// | | | | values: |
|
|
||||||
// | | 196 + a | 32 | 1. values Length |
|
|
||||||
// | | 228 + a | b | 2. values Contents |
|
|
||||||
// | | | | data: |
|
|
||||||
// | | 228 + a + b | 32 | 1. data Length |
|
|
||||||
// | | 260 + a + b | c | 2. data Contents |
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// (*): offset is computed from start of function parameters, so offset
|
|
||||||
// by an additional 4 bytes in the calldata.
|
|
||||||
//
|
|
||||||
// (**): the `Offset` column is computed assuming no calldata compression;
|
|
||||||
// offsets in the Data Area are dynamic and should be evaluated in
|
|
||||||
// real-time.
|
|
||||||
//
|
|
||||||
// WARNING: The ABIv2 specification allows additional padding between
|
|
||||||
// the Params and Data section. This will result in a larger
|
|
||||||
// offset to assetData.
|
|
||||||
//
|
|
||||||
// Note: Table #1 and Table #2 exist in Calldata. We construct Table #3 in memory.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
assembly {
|
|
||||||
// The first 4 bytes of calldata holds the function selector
|
|
||||||
let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
|
||||||
|
|
||||||
// `transferFrom` will be called with the following parameters:
|
// Scale values up by `amount`
|
||||||
// assetData Encoded byte array.
|
uint256 length = values.length;
|
||||||
// from Address to transfer asset from.
|
uint256[] memory scaledValues = new uint256[](length);
|
||||||
// to Address to transfer asset to.
|
for (uint256 i = 0; i != length; i++) {
|
||||||
// amount Amount of asset to transfer.
|
// We write the scaled values to an unused location in memory in order
|
||||||
// bytes4(keccak256("transferFrom(bytes,address,address,uint256)")) = 0xa85e59e4
|
// to avoid copying over `ids` or `data`. This is possible if they are
|
||||||
if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {
|
// identical to `values` and the offsets for each are pointing to the
|
||||||
|
// same location in the ABI encoded calldata.
|
||||||
// To lookup a value in a mapping, we load from the storage location keccak256(k, p),
|
scaledValues[i] = safeMul(values[i], amount);
|
||||||
// where k is the key left padded to 32 bytes and p is the storage slot
|
|
||||||
mstore(0, caller)
|
|
||||||
mstore(32, authorized_slot)
|
|
||||||
|
|
||||||
// Revert if authorized[msg.sender] == false
|
|
||||||
if iszero(sload(keccak256(0, 64))) {
|
|
||||||
// Revert with `Error("SENDER_NOT_AUTHORIZED")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x0000001553454e4445525f4e4f545f415554484f52495a454400000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construct Table #3 in memory, starting at memory offset 0.
|
|
||||||
// The algorithm below maps calldata (Table #1) and assetData (Table #2) to memory (Table #3).
|
|
||||||
// Once Table #3 ha been constructed in memory, the destination erc1155 contract is called using this
|
|
||||||
// as its calldata. This process is divided into three steps, below.
|
|
||||||
|
|
||||||
////////// STEP 1/3 - Map calldata to memory (Table #1 -> Table #3) //////////
|
|
||||||
|
|
||||||
// Store the safeBatchTransferFrom function selector, which is computed using:
|
|
||||||
// bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)"))
|
|
||||||
mstore(0, 0x2eb2c2d600000000000000000000000000000000000000000000000000000000)
|
|
||||||
|
|
||||||
// Copy `from` and `to` fields from calldata (Table #1) into memory (Table #3)
|
|
||||||
calldatacopy(
|
|
||||||
4, // aligned such that `from` and `to` are at the correct location for Table #3
|
|
||||||
36, // beginning of `from` field from Table #1
|
|
||||||
64 // 32 bytes for `from` + 32 bytes for `to` field
|
|
||||||
)
|
|
||||||
|
|
||||||
////////// STEP 2/3 - Map assetData to memory (Table #2 -> Table #3) //////////
|
|
||||||
|
|
||||||
// Map relevant fields from assetData (Table #2) into memory (Table #3)
|
|
||||||
// The Contents column of Table #2 is the same as Table #3,
|
|
||||||
// beginning from parameter 3 - `offset to ids (*)`
|
|
||||||
// The `values` from assetData (Table #2) are multiplied by `amount` (Table #1)
|
|
||||||
// when they are copied into memory.
|
|
||||||
|
|
||||||
// Load offset to `assetData`
|
|
||||||
let assetDataOffset := add(calldataload(4), 4)
|
|
||||||
|
|
||||||
// Load length in bytes of `assetData`
|
|
||||||
let assetDataLength := calldataload(assetDataOffset)
|
|
||||||
|
|
||||||
// Assert that the length of asset data:
|
|
||||||
// 1. Must be at least 132 bytes (Table #2)
|
|
||||||
// 2. Must be a multiple of 32 (excluding the 4-byte selector)
|
|
||||||
if or(lt(assetDataLength, 132), mod(sub(assetDataLength, 4), 32)) {
|
|
||||||
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// End of asset data in calldata
|
|
||||||
// +32 for length field
|
|
||||||
let assetDataEnd := add(assetDataOffset, add(assetDataLength, 32))
|
|
||||||
if gt(assetDataEnd, calldatasize()) {
|
|
||||||
// Revert with `Error("INVALID_ASSET_DATA_END")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load offset to parameters section in asset data
|
|
||||||
let paramsInAssetDataOffset := add(assetDataOffset, 36)
|
|
||||||
|
|
||||||
// Offset of end of Data Area in memory.
|
|
||||||
// This value will grow as we construct Table #3.
|
|
||||||
let dataAreaEndOffset := 164
|
|
||||||
|
|
||||||
// Load amount by which to scale values
|
|
||||||
let amount := calldataload(100)
|
|
||||||
|
|
||||||
// Store pointer to `ids` (Table #3)
|
|
||||||
// Subtract 4 for `safeBatchTransferFrom` selector
|
|
||||||
mstore(68, sub(dataAreaEndOffset, 4))
|
|
||||||
|
|
||||||
// Ensure length of `ids` does not overflow
|
|
||||||
let idsOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 68)))
|
|
||||||
let idsLength := calldataload(idsOffset)
|
|
||||||
let idsLengthInBytes := mul(idsLength, 32)
|
|
||||||
if sub(div(idsLengthInBytes, 32), idsLength) {
|
|
||||||
// Revert with `Error("UINT256_OVERFLOW")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure `ids` does not resolve to outside of `assetData`
|
|
||||||
let idsBegin := add(idsOffset, 32)
|
|
||||||
let idsEnd := add(idsBegin, idsLengthInBytes)
|
|
||||||
if gt(idsEnd, assetDataEnd) {
|
|
||||||
// Revert with `Error("INVALID_IDS_OFFSET")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000012494e56414c49445f4944535f4f464653455400000000000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy `ids` from `assetData` (Table #2) to memory (Table #3)
|
|
||||||
calldatacopy(
|
|
||||||
dataAreaEndOffset,
|
|
||||||
idsOffset,
|
|
||||||
add(idsLengthInBytes, 32)
|
|
||||||
)
|
|
||||||
dataAreaEndOffset := add(dataAreaEndOffset, add(idsLengthInBytes, 32))
|
|
||||||
|
|
||||||
// Store pointer to `values` (Table #3)
|
|
||||||
// Subtract 4 for `safeBatchTrasferFrom` selector
|
|
||||||
mstore(100, sub(dataAreaEndOffset, 4))
|
|
||||||
|
|
||||||
// Ensure length of `values` does not overflow
|
|
||||||
let valuesOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 100)))
|
|
||||||
let valuesLength := calldataload(valuesOffset)
|
|
||||||
let valuesLengthInBytes := mul(valuesLength, 32)
|
|
||||||
if sub(div(valuesLengthInBytes, 32), valuesLength) {
|
|
||||||
// Revert with `Error("UINT256_OVERFLOW")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure `values` does not resolve to outside of `assetData`
|
|
||||||
let valuesBegin := add(valuesOffset, 32)
|
|
||||||
let valuesEnd := add(valuesBegin, valuesLengthInBytes)
|
|
||||||
if gt(valuesEnd, assetDataEnd) {
|
|
||||||
// Revert with `Error("INVALID_VALUES_OFFSET")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000015494e56414c49445f56414c5545535f4f464653455400000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store length of `values`
|
|
||||||
mstore(dataAreaEndOffset, valuesLength)
|
|
||||||
dataAreaEndOffset := add(dataAreaEndOffset, 32)
|
|
||||||
|
|
||||||
// Scale and store elements of `values`
|
|
||||||
for { let currentValueOffset := valuesBegin }
|
|
||||||
lt(currentValueOffset, valuesEnd)
|
|
||||||
{ currentValueOffset := add(currentValueOffset, 32) }
|
|
||||||
{
|
|
||||||
// Load value and generate scaled value
|
|
||||||
let currentValue := calldataload(currentValueOffset)
|
|
||||||
let currentValueScaled := mul(currentValue, amount)
|
|
||||||
|
|
||||||
// Revert if `amount` != 0 and multiplication resulted in an overflow
|
|
||||||
if iszero(or(
|
|
||||||
iszero(amount),
|
|
||||||
eq(div(currentValueScaled, amount), currentValue)
|
|
||||||
)) {
|
|
||||||
// Revert with `Error("UINT256_OVERFLOW")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x0000001055494e543235365f4f564552464c4f57000000000000000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// There was no overflow, store the scaled token value
|
|
||||||
mstore(dataAreaEndOffset, currentValueScaled)
|
|
||||||
dataAreaEndOffset := add(dataAreaEndOffset, 32)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store pointer to `data` (Table #3)
|
|
||||||
// Subtract 4 for `safeBatchTrasferFrom` selector
|
|
||||||
mstore(132, sub(dataAreaEndOffset, 4))
|
|
||||||
|
|
||||||
// Ensure `data` does not resolve to outside of `assetData`
|
|
||||||
let dataOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 132)))
|
|
||||||
let dataLengthInBytes := calldataload(dataOffset)
|
|
||||||
let dataBegin := add(dataOffset, 32)
|
|
||||||
let dataEnd := add(dataBegin, dataLengthInBytes)
|
|
||||||
if gt(dataEnd, assetDataEnd) {
|
|
||||||
// Revert with `Error("INVALID_DATA_OFFSET")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000013494e56414c49445f444154415f4f4646534554000000000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy `data` from `assetData` (Table #2) to memory (Table #3)
|
|
||||||
calldatacopy(
|
|
||||||
dataAreaEndOffset,
|
|
||||||
dataOffset,
|
|
||||||
add(dataLengthInBytes, 32)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Update the end of data offset to be word-aligned
|
|
||||||
let dataLengthInWords := div(add(dataLengthInBytes, 31), 32)
|
|
||||||
let dataLengthInBytesWordAligned := mul(dataLengthInWords, 32)
|
|
||||||
dataAreaEndOffset := add(dataAreaEndOffset, add(dataLengthInBytesWordAligned, 32))
|
|
||||||
|
|
||||||
////////// STEP 3/3 - Execute Transfer //////////
|
|
||||||
// Load the address of the destination erc1155 contract from asset data (Table #2)
|
|
||||||
// +32 bytes for assetData Length
|
|
||||||
// +4 bytes for assetProxyId
|
|
||||||
let assetAddress := and(
|
|
||||||
calldataload(add(assetDataOffset, 36)),
|
|
||||||
0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff
|
|
||||||
)
|
|
||||||
|
|
||||||
// Call into the destination erc1155 contract using as calldata Table #3 (constructed in-memory above)
|
|
||||||
let success := call(
|
|
||||||
gas, // forward all gas
|
|
||||||
assetAddress, // call address of erc1155 asset
|
|
||||||
0, // don't send any ETH
|
|
||||||
0, // pointer to start of input
|
|
||||||
dataAreaEndOffset, // length of input is the end of the Data Area (Table #3)
|
|
||||||
0, // write output over memory that won't be reused
|
|
||||||
0 // don't copy output to memory
|
|
||||||
)
|
|
||||||
|
|
||||||
// Revert with reason given by AssetProxy if `transferFrom` call failed
|
|
||||||
if iszero(success) {
|
|
||||||
returndatacopy(
|
|
||||||
0, // copy to memory at 0
|
|
||||||
0, // copy from return data at 0
|
|
||||||
returndatasize() // copy all return data
|
|
||||||
)
|
|
||||||
revert(0, returndatasize())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return if call was successful
|
|
||||||
return(0, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Revert if undefined function is called
|
|
||||||
revert(0, 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Execute `safeBatchTransferFrom` call
|
||||||
|
// Either succeeds or throws
|
||||||
|
IERC1155(erc1155TokenAddress).safeBatchTransferFrom(
|
||||||
|
from,
|
||||||
|
to,
|
||||||
|
ids,
|
||||||
|
scaledValues,
|
||||||
|
data
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Gets the proxy id associated with the proxy address.
|
/// @dev Gets the proxy id associated with the proxy address.
|
||||||
|
@@ -90,7 +90,10 @@ contract MultiAssetProxy is
|
|||||||
// offset to assetData.
|
// offset to assetData.
|
||||||
|
|
||||||
// Load offset to `assetData`
|
// Load offset to `assetData`
|
||||||
let assetDataOffset := calldataload(4)
|
let assetDataOffset := add(calldataload(4), 4)
|
||||||
|
|
||||||
|
// Load length in bytes of `assetData`
|
||||||
|
let assetDataLength := calldataload(assetDataOffset)
|
||||||
|
|
||||||
// Asset data itself is encoded as follows:
|
// Asset data itself is encoded as follows:
|
||||||
//
|
//
|
||||||
@@ -108,41 +111,62 @@ contract MultiAssetProxy is
|
|||||||
// | | 132 + a | b | nestedAssetData Contents (offsets) |
|
// | | 132 + a | b | nestedAssetData Contents (offsets) |
|
||||||
// | | 132 + a + b | | nestedAssetData[0, ..., len] |
|
// | | 132 + a + b | | nestedAssetData[0, ..., len] |
|
||||||
|
|
||||||
|
// Assert that the length of asset data:
|
||||||
|
// 1. Must be at least 68 bytes (see table above)
|
||||||
|
// 2. Must be a multiple of 32 (excluding the 4-byte selector)
|
||||||
|
if or(lt(assetDataLength, 68), mod(sub(assetDataLength, 4), 32)) {
|
||||||
|
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
|
||||||
|
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
|
||||||
|
mstore(96, 0)
|
||||||
|
revert(0, 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of asset data in calldata
|
||||||
|
// assetDataOffset
|
||||||
|
// + 32 (assetData len)
|
||||||
|
let assetDataEnd := add(assetDataOffset, add(assetDataLength, 32))
|
||||||
|
if gt(assetDataEnd, calldatasize()) {
|
||||||
|
// Revert with `Error("INVALID_ASSET_DATA_END")`
|
||||||
|
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
|
||||||
|
mstore(96, 0)
|
||||||
|
revert(0, 100)
|
||||||
|
}
|
||||||
|
|
||||||
// In order to find the offset to `amounts`, we must add:
|
// In order to find the offset to `amounts`, we must add:
|
||||||
// 4 (function selector)
|
// assetDataOffset
|
||||||
// + assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
// + 32 (assetData len)
|
||||||
// + 4 (assetProxyId)
|
// + 4 (assetProxyId)
|
||||||
let amountsOffset := calldataload(add(assetDataOffset, 40))
|
let amountsOffset := calldataload(add(assetDataOffset, 36))
|
||||||
|
|
||||||
// In order to find the offset to `nestedAssetData`, we must add:
|
// In order to find the offset to `nestedAssetData`, we must add:
|
||||||
// 4 (function selector)
|
// assetDataOffset
|
||||||
// + assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
// + 32 (assetData len)
|
||||||
// + 4 (assetProxyId)
|
// + 4 (assetProxyId)
|
||||||
// + 32 (amounts offset)
|
// + 32 (amounts offset)
|
||||||
let nestedAssetDataOffset := calldataload(add(assetDataOffset, 72))
|
let nestedAssetDataOffset := calldataload(add(assetDataOffset, 68))
|
||||||
|
|
||||||
// In order to find the start of the `amounts` contents, we must add:
|
// In order to find the start of the `amounts` contents, we must add:
|
||||||
// 4 (function selector)
|
// assetDataOffset
|
||||||
// + assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
// + 32 (assetData len)
|
||||||
// + 4 (assetProxyId)
|
// + 4 (assetProxyId)
|
||||||
// + amountsOffset
|
// + amountsOffset
|
||||||
// + 32 (amounts len)
|
// + 32 (amounts len)
|
||||||
let amountsContentsStart := add(assetDataOffset, add(amountsOffset, 72))
|
let amountsContentsStart := add(assetDataOffset, add(amountsOffset, 68))
|
||||||
|
|
||||||
// Load number of elements in `amounts`
|
// Load number of elements in `amounts`
|
||||||
let amountsLen := calldataload(sub(amountsContentsStart, 32))
|
let amountsLen := calldataload(sub(amountsContentsStart, 32))
|
||||||
|
|
||||||
// In order to find the start of the `nestedAssetData` contents, we must add:
|
// In order to find the start of the `nestedAssetData` contents, we must add:
|
||||||
// 4 (function selector)
|
// assetDataOffset
|
||||||
// + assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
// + 32 (assetData len)
|
||||||
// + 4 (assetProxyId)
|
// + 4 (assetProxyId)
|
||||||
// + nestedAssetDataOffset
|
// + nestedAssetDataOffset
|
||||||
// + 32 (nestedAssetData len)
|
// + 32 (nestedAssetData len)
|
||||||
let nestedAssetDataContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, 72))
|
let nestedAssetDataContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, 68))
|
||||||
|
|
||||||
// Load number of elements in `nestedAssetData`
|
// Load number of elements in `nestedAssetData`
|
||||||
let nestedAssetDataLen := calldataload(sub(nestedAssetDataContentsStart, 32))
|
let nestedAssetDataLen := calldataload(sub(nestedAssetDataContentsStart, 32))
|
||||||
@@ -204,15 +228,20 @@ contract MultiAssetProxy is
|
|||||||
let nestedAssetDataElementOffset := calldataload(add(nestedAssetDataContentsStart, i))
|
let nestedAssetDataElementOffset := calldataload(add(nestedAssetDataContentsStart, i))
|
||||||
|
|
||||||
// In order to find the start of the `nestedAssetData[i]` contents, we must add:
|
// In order to find the start of the `nestedAssetData[i]` contents, we must add:
|
||||||
// 4 (function selector)
|
// assetDataOffset
|
||||||
// + assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
// + 32 (assetData len)
|
||||||
// + 4 (assetProxyId)
|
// + 4 (assetProxyId)
|
||||||
// + nestedAssetDataOffset
|
// + nestedAssetDataOffset
|
||||||
// + 32 (nestedAssetData len)
|
// + 32 (nestedAssetData len)
|
||||||
// + nestedAssetDataElementOffset
|
// + nestedAssetDataElementOffset
|
||||||
// + 32 (nestedAssetDataElement len)
|
// + 32 (nestedAssetDataElement len)
|
||||||
let nestedAssetDataElementContentsStart := add(assetDataOffset, add(nestedAssetDataOffset, add(nestedAssetDataElementOffset, 104)))
|
let nestedAssetDataElementContentsStart := add(
|
||||||
|
assetDataOffset,
|
||||||
|
add(
|
||||||
|
nestedAssetDataOffset,
|
||||||
|
add(nestedAssetDataElementOffset, 100)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
// Load length of `nestedAssetData[i]`
|
// Load length of `nestedAssetData[i]`
|
||||||
let nestedAssetDataElementLenStart := sub(nestedAssetDataElementContentsStart, 32)
|
let nestedAssetDataElementLenStart := sub(nestedAssetDataElementContentsStart, 32)
|
||||||
|
@@ -18,181 +18,57 @@
|
|||||||
|
|
||||||
pragma solidity ^0.5.9;
|
pragma solidity ^0.5.9;
|
||||||
|
|
||||||
|
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||||
|
|
||||||
|
|
||||||
|
// solhint-disable no-unused-vars
|
||||||
contract StaticCallProxy {
|
contract StaticCallProxy {
|
||||||
|
|
||||||
|
using LibBytes for bytes;
|
||||||
|
|
||||||
// Id of this proxy.
|
// Id of this proxy.
|
||||||
bytes4 constant internal PROXY_ID = bytes4(keccak256("StaticCall(address,bytes,bytes32)"));
|
bytes4 constant internal PROXY_ID = bytes4(keccak256("StaticCall(address,bytes,bytes32)"));
|
||||||
|
|
||||||
// solhint-disable-next-line payable-fallback
|
/// @dev Makes a staticcall to a target address and verifies that the data returned matches the expected return data.
|
||||||
function ()
|
/// @param assetData Byte array encoded with staticCallTarget, staticCallData, and expectedCallResultHash
|
||||||
|
/// @param from This value is ignored.
|
||||||
|
/// @param to This value is ignored.
|
||||||
|
/// @param amount This value is ignored.
|
||||||
|
function transferFrom(
|
||||||
|
bytes calldata assetData,
|
||||||
|
address from,
|
||||||
|
address to,
|
||||||
|
uint256 amount
|
||||||
|
)
|
||||||
external
|
external
|
||||||
|
view
|
||||||
{
|
{
|
||||||
assembly {
|
// Decode params from `assetData`
|
||||||
// The first 4 bytes of calldata holds the function selector
|
(
|
||||||
let selector := and(calldataload(0), 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
address staticCallTarget,
|
||||||
|
bytes memory staticCallData,
|
||||||
|
bytes32 expectedReturnDataHash
|
||||||
|
) = abi.decode(
|
||||||
|
assetData.sliceDestructive(4, assetData.length),
|
||||||
|
(address, bytes, bytes32)
|
||||||
|
);
|
||||||
|
|
||||||
// `transferFrom` will be called with the following parameters:
|
// Execute staticcall
|
||||||
// assetData Encoded byte array.
|
(bool success, bytes memory returnData) = staticCallTarget.staticcall(staticCallData);
|
||||||
// from Address to transfer asset from.
|
|
||||||
// to Address to transfer asset to.
|
|
||||||
// amount Amount of asset to transfer.
|
|
||||||
// bytes4(keccak256("transferFrom(bytes,address,address,uint256)")) = 0xa85e59e4
|
|
||||||
if eq(selector, 0xa85e59e400000000000000000000000000000000000000000000000000000000) {
|
|
||||||
|
|
||||||
// `transferFrom`.
|
// Revert with returned data if staticcall is unsuccessful
|
||||||
// The function is marked `external`, so no abi decoding is done for
|
if (!success) {
|
||||||
// us. Instead, we expect the `calldata` memory to contain the
|
assembly {
|
||||||
// following:
|
revert(add(returnData, 32), mload(returnData))
|
||||||
//
|
|
||||||
// | Area | Offset | Length | Contents |
|
|
||||||
// |----------|--------|---------|-------------------------------------|
|
|
||||||
// | Header | 0 | 4 | function selector |
|
|
||||||
// | Params | | 4 * 32 | function parameters: |
|
|
||||||
// | | 4 | | 1. offset to assetData (*) |
|
|
||||||
// | | 36 | | 2. from |
|
|
||||||
// | | 68 | | 3. to |
|
|
||||||
// | | 100 | | 4. amount |
|
|
||||||
// | Data | | | assetData: |
|
|
||||||
// | | 132 | 32 | assetData Length |
|
|
||||||
// | | 164 | ** | assetData Contents |
|
|
||||||
//
|
|
||||||
// (*): offset is computed from start of function parameters, so offset
|
|
||||||
// by an additional 4 bytes in the calldata.
|
|
||||||
//
|
|
||||||
// (**): see table below to compute length of assetData Contents
|
|
||||||
// (***): Note that the `from`, `to`, and `amount` params in calldata are ignored in this function.
|
|
||||||
//
|
|
||||||
// WARNING: The ABIv2 specification allows additional padding between
|
|
||||||
// the Params and Data section. This will result in a larger
|
|
||||||
// offset to assetData.
|
|
||||||
|
|
||||||
// Load offset to `assetData`
|
|
||||||
let assetDataOffset := add(calldataload(4), 4)
|
|
||||||
|
|
||||||
// Validate length of `assetData`
|
|
||||||
let assetDataLen := calldataload(assetDataOffset)
|
|
||||||
if or(lt(assetDataLen, 100), mod(sub(assetDataLen, 4), 32)) {
|
|
||||||
// Revert with `Error("INVALID_ASSET_DATA_LENGTH")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000019494e56414c49445f41535345545f444154415f4c454e475448000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure that `assetData` ends inside of calldata
|
|
||||||
let assetDataEnd := add(assetDataOffset, add(assetDataLen, 32))
|
|
||||||
if gt(assetDataEnd, calldatasize()) {
|
|
||||||
// Revert with `Error("INVALID_ASSET_DATA_END")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x00000016494e56414c49445f41535345545f444154415f454e44000000000000)
|
|
||||||
mstore(96, 0)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Asset data is encoded as follows:
|
|
||||||
// | Area | Offset | Length | Contents |
|
|
||||||
// |----------|-------------|---------|--------------------------------------|
|
|
||||||
// | Header | 0 | 4 | assetProxyId |
|
|
||||||
// | Params | | 4 * 32 | function parameters: |
|
|
||||||
// | | 4 | | 1. address of callTarget |
|
|
||||||
// | | 36 | | 2. offset to staticCallData (*) |
|
|
||||||
// | | 68 | | 3. expected 32 byte hash of output |
|
|
||||||
// | Data | | | staticCallData: |
|
|
||||||
// | | 100 | 32 | 1. staticCallData Length |
|
|
||||||
// | | 132 | a | 2. staticCallData Contents |
|
|
||||||
|
|
||||||
// In order to find the offset to `staticCallData`, we must add:
|
|
||||||
// assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
|
||||||
// + 4 (proxyId)
|
|
||||||
// + 32 (callTarget)
|
|
||||||
let paramsInAssetDataOffset := add(assetDataOffset, 36)
|
|
||||||
let staticCallDataOffset := add(paramsInAssetDataOffset, calldataload(add(assetDataOffset, 68)))
|
|
||||||
|
|
||||||
// Load length of `staticCallData`
|
|
||||||
let staticCallDataLen := calldataload(staticCallDataOffset)
|
|
||||||
|
|
||||||
// Ensure `staticCallData` does not begin to outside of `assetData`
|
|
||||||
let staticCallDataBegin := add(staticCallDataOffset, 32)
|
|
||||||
let staticCallDataEnd := add(staticCallDataBegin, staticCallDataLen)
|
|
||||||
if gt(staticCallDataEnd, assetDataEnd) {
|
|
||||||
// Revert with `Error("INVALID_STATIC_CALL_DATA_OFFSET")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x0000001f494e56414c49445f5354415449435f43414c4c5f444154415f4f4646)
|
|
||||||
mstore(96, 0x5345540000000000000000000000000000000000000000000000000000000000)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy `staticCallData` into memory
|
|
||||||
calldatacopy(
|
|
||||||
0, // memory can be safely overwritten from beginning
|
|
||||||
staticCallDataBegin, // start of `staticCallData`
|
|
||||||
staticCallDataLen // copy the entire `staticCallData`
|
|
||||||
)
|
|
||||||
|
|
||||||
// In order to find the offset to `callTarget`, we must add:
|
|
||||||
// assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
|
||||||
// + 4 (proxyId)
|
|
||||||
let callTarget := and(
|
|
||||||
calldataload(add(assetDataOffset, 36)),
|
|
||||||
0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff
|
|
||||||
)
|
|
||||||
|
|
||||||
// Perform `callTarget.staticcall(staticCallData)`
|
|
||||||
let success := staticcall(
|
|
||||||
gas, // forward all gas
|
|
||||||
callTarget, // call address `callTarget`
|
|
||||||
0, // pointer to start of input
|
|
||||||
staticCallDataLen, // length of input
|
|
||||||
0, // start of memory can be safely overwritten
|
|
||||||
0 // don't copy output to memory
|
|
||||||
)
|
|
||||||
|
|
||||||
// Copy entire output to start of memory
|
|
||||||
let outputLen := returndatasize()
|
|
||||||
returndatacopy(
|
|
||||||
0, // copy to memory at 0
|
|
||||||
0, // copy from return data at 0
|
|
||||||
outputLen // copy all return data
|
|
||||||
)
|
|
||||||
|
|
||||||
// Revert with reason given by `callTarget` if staticcall is unsuccessful
|
|
||||||
if iszero(success) {
|
|
||||||
revert(0, outputLen)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate hash of output
|
|
||||||
let callResultHash := keccak256(0, outputLen)
|
|
||||||
|
|
||||||
// In order to find the offset to `expectedCallResultHash`, we must add:
|
|
||||||
// assetDataOffset
|
|
||||||
// + 32 (assetData len)
|
|
||||||
// + 4 (proxyId)
|
|
||||||
// + 32 (callTarget)
|
|
||||||
// + 32 (staticCallDataOffset)
|
|
||||||
let expectedResultHash := calldataload(add(assetDataOffset, 100))
|
|
||||||
|
|
||||||
if sub(callResultHash, expectedResultHash) {
|
|
||||||
// Revert with `Error("UNEXPECTED_STATIC_CALL_RESULT")`
|
|
||||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
|
||||||
mstore(64, 0x0000001d554e45585045435445445f5354415449435f43414c4c5f524553554c)
|
|
||||||
mstore(96, 0x5400000000000000000000000000000000000000000000000000000000000000)
|
|
||||||
revert(0, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return if output matched expected output
|
|
||||||
return(0, 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Revert if undefined function is called
|
|
||||||
revert(0, 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Revert if hash of return data is not as expected
|
||||||
|
bytes32 returnDataHash = keccak256(returnData);
|
||||||
|
require(
|
||||||
|
expectedReturnDataHash == returnDataHash,
|
||||||
|
"UNEXPECTED_STATIC_CALL_RESULT"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Gets the proxy id associated with the proxy address.
|
/// @dev Gets the proxy id associated with the proxy address.
|
||||||
@@ -204,4 +80,4 @@ contract StaticCallProxy {
|
|||||||
{
|
{
|
||||||
return PROXY_ID;
|
return PROXY_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,9 +21,8 @@ pragma solidity ^0.5.5;
|
|||||||
import "./IAuthorizable.sol";
|
import "./IAuthorizable.sol";
|
||||||
|
|
||||||
|
|
||||||
contract IAssetProxy is
|
contract IAssetProxy {
|
||||||
IAuthorizable
|
|
||||||
{
|
|
||||||
/// @dev Transfers assets. Either succeeds or throws.
|
/// @dev Transfers assets. Either succeeds or throws.
|
||||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||||
/// @param from Address to transfer asset from.
|
/// @param from Address to transfer asset from.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-asset-proxy",
|
"name": "@0x/contracts-asset-proxy",
|
||||||
"version": "2.2.1",
|
"version": "2.2.8",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,17 +69,17 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-erc1155": "^1.1.8",
|
"@0x/contracts-erc1155": "^1.1.15",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-erc721": "^2.1.8",
|
"@0x/contracts-erc721": "^2.1.15",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"ethereumjs-util": "^5.1.1",
|
"ethereumjs-util": "^5.1.1",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
|
@@ -37,6 +37,7 @@ describe('Authorizable', () => {
|
|||||||
artifacts.MixinAuthorizable,
|
artifacts.MixinAuthorizable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -23,7 +23,7 @@ import { LogWithDecodedArgs } from 'ethereum-types';
|
|||||||
import * as ethUtil from 'ethereumjs-util';
|
import * as ethUtil from 'ethereumjs-util';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { ERC1155ProxyWrapper, ERC721ProxyContract } from '../src';
|
import { artifacts, ERC1155ProxyContract, ERC1155ProxyWrapper } from '../src';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
@@ -51,7 +51,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
let receiver: string;
|
let receiver: string;
|
||||||
let receiverContract: string;
|
let receiverContract: string;
|
||||||
// contracts & wrappers
|
// contracts & wrappers
|
||||||
let erc1155Proxy: ERC721ProxyContract;
|
let erc1155Proxy: ERC1155ProxyContract;
|
||||||
let erc1155Receiver: DummyERC1155ReceiverContract;
|
let erc1155Receiver: DummyERC1155ReceiverContract;
|
||||||
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
|
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
|
||||||
let erc1155Contract: ERC1155MintableContract;
|
let erc1155Contract: ERC1155MintableContract;
|
||||||
@@ -89,6 +89,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
erc1155Artifacts.DummyERC1155Receiver,
|
erc1155Artifacts.DummyERC1155Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
receiverContract = erc1155Receiver.address;
|
receiverContract = erc1155Receiver.address;
|
||||||
await erc1155ProxyWrapper.setBalancesAndAllowancesAsync();
|
await erc1155ProxyWrapper.setBalancesAndAllowancesAsync();
|
||||||
@@ -1077,7 +1078,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token ids to point outside the calldata.
|
// We want to change the offset to token ids to point outside the calldata.
|
||||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000180';
|
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000180';
|
||||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||||
@@ -1085,7 +1086,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
badEncodedOffsetToTokenIds,
|
badEncodedOffsetToTokenIds,
|
||||||
);
|
);
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1097,7 +1098,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithBadTokenIdsOffset,
|
assetDataWithBadTokenIdsOffset,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidIdsOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if an element of token ids lies to outside the bounds of calldata', async () => {
|
it('should revert if an element of token ids lies to outside the bounds of calldata', async () => {
|
||||||
@@ -1125,7 +1125,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token ids to the end of calldata.
|
// We want to change the offset to token ids to the end of calldata.
|
||||||
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
|
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
|
||||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
const newEcodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
const newEcodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||||
@@ -1137,7 +1137,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const encodedTokenIdValues = '0000000000000000000000000000000000000000000000000000000000000001';
|
const encodedTokenIdValues = '0000000000000000000000000000000000000000000000000000000000000001';
|
||||||
const assetDataWithBadTokenIds = `${assetDataWithNewTokenIdsOffset}${encodedTokenIdsLength}${encodedTokenIdValues}`;
|
const assetDataWithBadTokenIds = `${assetDataWithNewTokenIdsOffset}${encodedTokenIdsLength}${encodedTokenIdValues}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1149,7 +1149,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithBadTokenIds,
|
assetDataWithBadTokenIds,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidIdsOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert token ids length overflows', async () => {
|
it('should revert token ids length overflows', async () => {
|
||||||
@@ -1177,7 +1176,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token ids to point to the end of calldata
|
// We want to change the offset to token ids to point to the end of calldata
|
||||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||||
@@ -1189,7 +1188,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const buffer = '0'.repeat(64 * 10);
|
const buffer = '0'.repeat(64 * 10);
|
||||||
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1201,7 +1200,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithOverflow,
|
assetDataWithOverflow,
|
||||||
),
|
),
|
||||||
RevertReason.Uint256Overflow,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert token values length overflows', async () => {
|
it('should revert token values length overflows', async () => {
|
||||||
@@ -1229,7 +1227,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token values to point to the end of calldata
|
// We want to change the offset to token values to point to the end of calldata
|
||||||
const encodedOffsetToTokenIds = '00000000000000000000000000000000000000000000000000000000000000c0';
|
const encodedOffsetToTokenIds = '00000000000000000000000000000000000000000000000000000000000000c0';
|
||||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||||
@@ -1241,7 +1239,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const buffer = '0'.repeat(64 * 10);
|
const buffer = '0'.repeat(64 * 10);
|
||||||
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1253,7 +1251,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithOverflow,
|
assetDataWithOverflow,
|
||||||
),
|
),
|
||||||
RevertReason.Uint256Overflow,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert token data length overflows', async () => {
|
it('should revert token data length overflows', async () => {
|
||||||
@@ -1281,7 +1278,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token ids to point to the end of calldata,
|
// We want to change the offset to token ids to point to the end of calldata,
|
||||||
// which we'll extend with a bad length.
|
// which we'll extend with a bad length.
|
||||||
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000100';
|
const encodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000100';
|
||||||
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
const badEncodedOffsetToTokenIds = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||||
@@ -1294,7 +1291,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const buffer = '0'.repeat(64 * 10);
|
const buffer = '0'.repeat(64 * 10);
|
||||||
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
const assetDataWithOverflow = `${assetDataWithBadTokenIdsOffset}${encodedIdsLengthOverflow}${buffer}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1306,7 +1303,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithOverflow,
|
assetDataWithOverflow,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidDataOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if token values resolves to outside the bounds of calldata', async () => {
|
it('should revert if token values resolves to outside the bounds of calldata', async () => {
|
||||||
@@ -1334,7 +1330,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token values to point outside the calldata.
|
// We want to change the offset to token values to point outside the calldata.
|
||||||
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
|
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
|
||||||
const badEncodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000001c0';
|
const badEncodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000001c0';
|
||||||
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
const assetDataWithBadTokenIdsOffset = assetData.replace(
|
||||||
@@ -1342,7 +1338,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
badEncodedOffsetToTokenValues,
|
badEncodedOffsetToTokenValues,
|
||||||
);
|
);
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1354,7 +1350,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithBadTokenIdsOffset,
|
assetDataWithBadTokenIdsOffset,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidValuesOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if an element of token values lies to outside the bounds of calldata', async () => {
|
it('should revert if an element of token values lies to outside the bounds of calldata', async () => {
|
||||||
@@ -1382,7 +1377,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token values to the end of calldata.
|
// We want to change the offset to token values to the end of calldata.
|
||||||
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
|
// Then we'll add an invalid length: we encode length of 2 but only add 1 element.
|
||||||
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
|
const encodedOffsetToTokenValues = '00000000000000000000000000000000000000000000000000000000000000c0';
|
||||||
const newEcodedOffsetToTokenValues = '0000000000000000000000000000000000000000000000000000000000000140';
|
const newEcodedOffsetToTokenValues = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||||
@@ -1394,7 +1389,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const encodedTokenValuesElements = '0000000000000000000000000000000000000000000000000000000000000001';
|
const encodedTokenValuesElements = '0000000000000000000000000000000000000000000000000000000000000001';
|
||||||
const assetDataWithBadTokenIds = `${assetDataWithNewTokenValuesOffset}${encodedTokenValuesLength}${encodedTokenValuesElements}`;
|
const assetDataWithBadTokenIds = `${assetDataWithNewTokenValuesOffset}${encodedTokenValuesLength}${encodedTokenValuesElements}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1406,7 +1401,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithBadTokenIds,
|
assetDataWithBadTokenIds,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidValuesOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if token data resolves to outside the bounds of calldata', async () => {
|
it('should revert if token data resolves to outside the bounds of calldata', async () => {
|
||||||
@@ -1434,7 +1428,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token data to point outside the calldata.
|
// We want to change the offset to token data to point outside the calldata.
|
||||||
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
|
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
|
||||||
const badEncodedOffsetToTokenData = '00000000000000000000000000000000000000000000000000000000000001c0';
|
const badEncodedOffsetToTokenData = '00000000000000000000000000000000000000000000000000000000000001c0';
|
||||||
const assetDataWithBadTokenDataOffset = assetData.replace(
|
const assetDataWithBadTokenDataOffset = assetData.replace(
|
||||||
@@ -1442,7 +1436,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
badEncodedOffsetToTokenData,
|
badEncodedOffsetToTokenData,
|
||||||
);
|
);
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1454,7 +1448,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithBadTokenDataOffset,
|
assetDataWithBadTokenDataOffset,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidDataOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if an element of token data lies to outside the bounds of calldata', async () => {
|
it('should revert if an element of token data lies to outside the bounds of calldata', async () => {
|
||||||
@@ -1482,7 +1475,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
// 0x100 0000000000000000000000000000000000000000000000000000000000000004
|
||||||
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
// 0x120 0102030400000000000000000000000000000000000000000000000000000000
|
||||||
//
|
//
|
||||||
// We want to chan ge the offset to token data to the end of calldata.
|
// We want to change the offset to token data to the end of calldata.
|
||||||
// Then we'll add an invalid length: we encode length of 33 but only add 32 elements.
|
// Then we'll add an invalid length: we encode length of 33 but only add 32 elements.
|
||||||
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
|
const encodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000100';
|
||||||
const newEcodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000140';
|
const newEcodedOffsetToTokenData = '0000000000000000000000000000000000000000000000000000000000000140';
|
||||||
@@ -1494,7 +1487,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const encodedTokenDataElements = '0000000000000000000000000000000000000000000000000000000000000001';
|
const encodedTokenDataElements = '0000000000000000000000000000000000000000000000000000000000000001';
|
||||||
const assetDataWithBadTokenData = `${assetDataWithNewTokenDataOffset}${encodedTokenDataLength}${encodedTokenDataElements}`;
|
const assetDataWithBadTokenData = `${assetDataWithNewTokenDataOffset}${encodedTokenDataLength}${encodedTokenDataElements}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1506,7 +1499,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithBadTokenData,
|
assetDataWithBadTokenData,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidDataOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if asset data lies outside the bounds of calldata', async () => {
|
it('should revert if asset data lies outside the bounds of calldata', async () => {
|
||||||
@@ -1536,9 +1528,8 @@ describe('ERC1155Proxy', () => {
|
|||||||
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000180';
|
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000180';
|
||||||
const badTxData = txData.replace(offsetToAssetData, invalidOffsetToAssetData);
|
const badTxData = txData.replace(offsetToAssetData, invalidOffsetToAssetData);
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
||||||
RevertReason.InvalidAssetDataLength,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if asset data lies outside the bounds of calldata', async () => {
|
it('should revert if asset data lies outside the bounds of calldata', async () => {
|
||||||
@@ -1570,39 +1561,8 @@ describe('ERC1155Proxy', () => {
|
|||||||
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||||
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
||||||
RevertReason.InvalidAssetDataEnd,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it('should revert if length of assetData, excluding the selector, is not a multiple of 32', async () => {
|
|
||||||
// setup test parameters
|
|
||||||
const tokensToTransfer = fungibleTokens.slice(0, 1);
|
|
||||||
const valuesToTransfer = [fungibleValueToTransferLarge];
|
|
||||||
const valueMultiplier = valueMultiplierSmall;
|
|
||||||
const erc1155ContractAddress = erc1155Wrapper.getContract().address;
|
|
||||||
const assetData = assetDataUtils.encodeERC1155AssetData(
|
|
||||||
erc1155ContractAddress,
|
|
||||||
tokensToTransfer,
|
|
||||||
valuesToTransfer,
|
|
||||||
receiverCallbackData,
|
|
||||||
);
|
|
||||||
const extraData = '01';
|
|
||||||
const assetDataWithExtraData = `${assetData}${extraData}`;
|
|
||||||
// execute transfer
|
|
||||||
await expectTransactionFailedAsync(
|
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
|
||||||
spender,
|
|
||||||
receiverContract,
|
|
||||||
erc1155Contract.address,
|
|
||||||
tokensToTransfer,
|
|
||||||
valuesToTransfer,
|
|
||||||
valueMultiplier,
|
|
||||||
receiverCallbackData,
|
|
||||||
authorized,
|
|
||||||
assetDataWithExtraData,
|
|
||||||
),
|
|
||||||
RevertReason.InvalidAssetDataLength,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if length of assetData is less than 132 bytes', async () => {
|
it('should revert if length of assetData is less than 132 bytes', async () => {
|
||||||
@@ -1618,7 +1578,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
const zeros96Bytes = '0'.repeat(188);
|
const zeros96Bytes = '0'.repeat(188);
|
||||||
const assetData131Bytes = `${AssetProxyId.ERC1155}${zeros96Bytes}`;
|
const assetData131Bytes = `${AssetProxyId.ERC1155}${zeros96Bytes}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
erc1155ProxyWrapper.transferFromAsync(
|
erc1155ProxyWrapper.transferFromAsync(
|
||||||
spender,
|
spender,
|
||||||
receiverContract,
|
receiverContract,
|
||||||
@@ -1630,7 +1590,6 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetData131Bytes,
|
assetData131Bytes,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidAssetDataLength,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should transfer nothing if value is zero', async () => {
|
it('should transfer nothing if value is zero', async () => {
|
||||||
|
@@ -23,7 +23,7 @@ import {
|
|||||||
} from '@0x/contracts-test-utils';
|
} from '@0x/contracts-test-utils';
|
||||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||||
import { assetDataUtils } from '@0x/order-utils';
|
import { assetDataUtils } from '@0x/order-utils';
|
||||||
import { RevertReason } from '@0x/types';
|
import { AssetProxyId, RevertReason } from '@0x/types';
|
||||||
import { BigNumber } from '@0x/utils';
|
import { BigNumber } from '@0x/utils';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import { LogWithDecodedArgs } from 'ethereum-types';
|
import { LogWithDecodedArgs } from 'ethereum-types';
|
||||||
@@ -31,6 +31,7 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
artifacts,
|
artifacts,
|
||||||
|
ERC1155ProxyContract,
|
||||||
ERC1155ProxyWrapper,
|
ERC1155ProxyWrapper,
|
||||||
ERC20ProxyContract,
|
ERC20ProxyContract,
|
||||||
ERC20Wrapper,
|
ERC20Wrapper,
|
||||||
@@ -71,7 +72,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
let erc721AFromTokenId: BigNumber;
|
let erc721AFromTokenId: BigNumber;
|
||||||
let erc721BFromTokenId: BigNumber;
|
let erc721BFromTokenId: BigNumber;
|
||||||
|
|
||||||
let erc1155Proxy: ERC721ProxyContract;
|
let erc1155Proxy: ERC1155ProxyContract;
|
||||||
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
|
let erc1155ProxyWrapper: ERC1155ProxyWrapper;
|
||||||
let erc1155Contract: ERC1155MintableContract;
|
let erc1155Contract: ERC1155MintableContract;
|
||||||
let erc1155Contract2: ERC1155MintableContract;
|
let erc1155Contract2: ERC1155MintableContract;
|
||||||
@@ -100,6 +101,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
artifacts.MultiAssetProxy,
|
artifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Configure ERC20Proxy
|
// Configure ERC20Proxy
|
||||||
@@ -172,6 +174,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
erc20Artifacts.DummyNoReturnERC20Token,
|
erc20Artifacts.DummyNoReturnERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
@@ -181,6 +184,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
erc20Artifacts.DummyMultipleReturnERC20Token,
|
erc20Artifacts.DummyMultipleReturnERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
@@ -223,6 +227,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
erc721Artifacts.DummyERC721Receiver,
|
erc721Artifacts.DummyERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
await erc721Wrapper.setBalancesAndAllowancesAsync();
|
await erc721Wrapper.setBalancesAndAllowancesAsync();
|
||||||
@@ -1329,7 +1334,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||||
const amounts = [erc20Amount, erc721Amount];
|
const amounts = [erc20Amount, erc721Amount];
|
||||||
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||||
const extraData = '0102030405060708';
|
const extraData = '0102030405060708090001020304050607080900010203040506070809000102';
|
||||||
const assetData = `${assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData)}${extraData}`;
|
const assetData = `${assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData)}${extraData}`;
|
||||||
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||||
assetData,
|
assetData,
|
||||||
@@ -1624,6 +1629,120 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
RevertReason.SenderNotAuthorized,
|
RevertReason.SenderNotAuthorized,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('should revert if asset data overflows beyond the bounds of calldata', async () => {
|
||||||
|
const inputAmount = new BigNumber(1);
|
||||||
|
const erc20Amount = new BigNumber(10);
|
||||||
|
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
|
||||||
|
const erc721Amount = new BigNumber(1);
|
||||||
|
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||||
|
const amounts = [erc20Amount, erc721Amount];
|
||||||
|
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||||
|
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
|
||||||
|
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||||
|
assetData,
|
||||||
|
fromAddress,
|
||||||
|
toAddress,
|
||||||
|
inputAmount,
|
||||||
|
);
|
||||||
|
// append asset data to end of tx data with a length of 0x300 bytes, which will extend past actual calldata.
|
||||||
|
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
|
const invalidOffsetToAssetData = '00000000000000000000000000000000000000000000000000000000000002a0';
|
||||||
|
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||||
|
const badData = `${data.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||||
|
// execute transfer
|
||||||
|
await expectTransactionFailedAsync(
|
||||||
|
web3Wrapper.sendTransactionAsync({
|
||||||
|
to: multiAssetProxy.address,
|
||||||
|
data: badData,
|
||||||
|
from: authorized,
|
||||||
|
}),
|
||||||
|
RevertReason.InvalidAssetDataEnd,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should revert if asset data resolves to a location beyond the bounds of calldata', async () => {
|
||||||
|
const inputAmount = new BigNumber(1);
|
||||||
|
const erc20Amount = new BigNumber(10);
|
||||||
|
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
|
||||||
|
const erc721Amount = new BigNumber(1);
|
||||||
|
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||||
|
const amounts = [erc20Amount, erc721Amount];
|
||||||
|
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||||
|
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
|
||||||
|
const data = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||||
|
assetData,
|
||||||
|
fromAddress,
|
||||||
|
toAddress,
|
||||||
|
inputAmount,
|
||||||
|
);
|
||||||
|
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
|
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000400';
|
||||||
|
const badData = data.replace(offsetToAssetData, invalidOffsetToAssetData);
|
||||||
|
// execute transfer
|
||||||
|
// note that this triggers `InvalidAssetDataLength` because the length is zero, otherwise it would
|
||||||
|
// trigger `InvalidAssetDataEnd`.
|
||||||
|
await expectTransactionFailedAsync(
|
||||||
|
web3Wrapper.sendTransactionAsync({
|
||||||
|
to: multiAssetProxy.address,
|
||||||
|
data: badData,
|
||||||
|
from: authorized,
|
||||||
|
}),
|
||||||
|
RevertReason.InvalidAssetDataLength,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should revert if length of assetData, excluding the selector, is not a multiple of 32', async () => {
|
||||||
|
// setup test parameters
|
||||||
|
const inputAmount = new BigNumber(1);
|
||||||
|
const erc20Amount = new BigNumber(10);
|
||||||
|
const erc20AssetData = assetDataUtils.encodeERC20AssetData(erc20TokenA.address);
|
||||||
|
const erc721Amount = new BigNumber(1);
|
||||||
|
const erc721AssetData = assetDataUtils.encodeERC721AssetData(erc721TokenA.address, erc721AFromTokenId);
|
||||||
|
const amounts = [erc20Amount, erc721Amount];
|
||||||
|
const nestedAssetData = [erc20AssetData, erc721AssetData];
|
||||||
|
const assetData = assetDataUtils.encodeMultiAssetData(amounts, nestedAssetData);
|
||||||
|
const extraData = '01';
|
||||||
|
const assetDataWithExtraData = `${assetData}${extraData}`;
|
||||||
|
const badData = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||||
|
assetDataWithExtraData,
|
||||||
|
fromAddress,
|
||||||
|
toAddress,
|
||||||
|
inputAmount,
|
||||||
|
);
|
||||||
|
// execute transfer
|
||||||
|
await expectTransactionFailedAsync(
|
||||||
|
web3Wrapper.sendTransactionAsync({
|
||||||
|
to: multiAssetProxy.address,
|
||||||
|
data: badData,
|
||||||
|
from: authorized,
|
||||||
|
}),
|
||||||
|
RevertReason.InvalidAssetDataLength,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should revert if length of assetData is less than 68 bytes', async () => {
|
||||||
|
// setup test parameters
|
||||||
|
const inputAmount = new BigNumber(1);
|
||||||
|
// we'll construct asset data that has a 4 byte selector plus
|
||||||
|
// 32 byte payload. This results in asset data that is 36 bytes
|
||||||
|
// long and will trigger the `invalid length` error.
|
||||||
|
// we must be sure to use a # of bytes that is still %32
|
||||||
|
// so that we know the error is not triggered by another check in the code.
|
||||||
|
const zeros32Bytes = '0'.repeat(64);
|
||||||
|
const assetData36Bytes = `${AssetProxyId.MultiAsset}${zeros32Bytes}`;
|
||||||
|
const badData = assetProxyInterface.transferFrom.getABIEncodedTransactionData(
|
||||||
|
assetData36Bytes,
|
||||||
|
fromAddress,
|
||||||
|
toAddress,
|
||||||
|
inputAmount,
|
||||||
|
);
|
||||||
|
// execute transfer
|
||||||
|
await expectTransactionFailedAsync(
|
||||||
|
web3Wrapper.sendTransactionAsync({
|
||||||
|
to: multiAssetProxy.address,
|
||||||
|
data: badData,
|
||||||
|
from: authorized,
|
||||||
|
}),
|
||||||
|
RevertReason.InvalidAssetDataLength,
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -41,12 +41,14 @@ describe('StaticCallProxy', () => {
|
|||||||
artifacts.StaticCallProxy,
|
artifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
||||||
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallTarget,
|
artifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@@ -95,26 +97,12 @@ describe('StaticCallProxy', () => {
|
|||||||
const invalidOffsetToAssetData = ethUtil.bufferToHex(paddedTxDataEndBuffer).slice(2);
|
const invalidOffsetToAssetData = ethUtil.bufferToHex(paddedTxDataEndBuffer).slice(2);
|
||||||
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||||
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
web3Wrapper.sendTransactionAsync({
|
web3Wrapper.sendTransactionAsync({
|
||||||
to: staticCallProxy.address,
|
to: staticCallProxy.address,
|
||||||
from: fromAddress,
|
from: fromAddress,
|
||||||
data: badTxData,
|
data: badTxData,
|
||||||
}),
|
}),
|
||||||
RevertReason.InvalidAssetDataEnd,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it('should revert if the length of assetData, excluding the proxyId, is not a multiple of 32', async () => {
|
|
||||||
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
|
|
||||||
const expectedResultHash = constants.KECCAK256_NULL;
|
|
||||||
const assetData = `${assetDataUtils.encodeStaticCallAssetData(
|
|
||||||
staticCallTarget.address,
|
|
||||||
staticCallData,
|
|
||||||
expectedResultHash,
|
|
||||||
)}01`;
|
|
||||||
await expectTransactionFailedAsync(
|
|
||||||
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
|
|
||||||
RevertReason.InvalidAssetDataLength,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if the length of assetData is less than 100 bytes', async () => {
|
it('should revert if the length of assetData is less than 100 bytes', async () => {
|
||||||
@@ -125,9 +113,8 @@ describe('StaticCallProxy', () => {
|
|||||||
.slice(0, -128);
|
.slice(0, -128);
|
||||||
const assetDataByteLen = (assetData.length - 2) / 2;
|
const assetDataByteLen = (assetData.length - 2) / 2;
|
||||||
expect((assetDataByteLen - 4) % 32).to.equal(0);
|
expect((assetDataByteLen - 4) % 32).to.equal(0);
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
|
staticCallProxy.transferFrom.sendTransactionAsync(assetData, fromAddress, toAddress, amount),
|
||||||
RevertReason.InvalidAssetDataLength,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if the offset to `staticCallData` points to outside of assetData', async () => {
|
it('should revert if the offset to `staticCallData` points to outside of assetData', async () => {
|
||||||
@@ -147,9 +134,8 @@ describe('StaticCallProxy', () => {
|
|||||||
offsetToStaticCallData,
|
offsetToStaticCallData,
|
||||||
invalidOffsetToStaticCallData,
|
invalidOffsetToStaticCallData,
|
||||||
)}${newStaticCallData}`;
|
)}${newStaticCallData}`;
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedWithoutReasonAsync(
|
||||||
staticCallProxy.transferFrom.sendTransactionAsync(badAssetData, fromAddress, toAddress, amount),
|
staticCallProxy.transferFrom.sendTransactionAsync(badAssetData, fromAddress, toAddress, amount),
|
||||||
RevertReason.InvalidStaticCallDataOffset,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if the callTarget attempts to write to state', async () => {
|
it('should revert if the callTarget attempts to write to state', async () => {
|
||||||
@@ -191,7 +177,7 @@ describe('StaticCallProxy', () => {
|
|||||||
RevertReason.UnexpectedStaticCallResult,
|
RevertReason.UnexpectedStaticCallResult,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should be successful if a function call with no inputs is successful', async () => {
|
it('should be successful if a function call with no inputs and no outputs is successful', async () => {
|
||||||
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
|
const staticCallData = staticCallTarget.noInputFunction.getABIEncodedTransactionData();
|
||||||
const expectedResultHash = constants.KECCAK256_NULL;
|
const expectedResultHash = constants.KECCAK256_NULL;
|
||||||
const assetData = assetDataUtils.encodeStaticCallAssetData(
|
const assetData = assetDataUtils.encodeStaticCallAssetData(
|
||||||
@@ -201,6 +187,12 @@ describe('StaticCallProxy', () => {
|
|||||||
);
|
);
|
||||||
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
|
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
|
||||||
});
|
});
|
||||||
|
it('should be successful if the staticCallTarget is not a contract and no return value is expected', async () => {
|
||||||
|
const staticCallData = '0x0102030405060708';
|
||||||
|
const expectedResultHash = constants.KECCAK256_NULL;
|
||||||
|
const assetData = assetDataUtils.encodeStaticCallAssetData(toAddress, staticCallData, expectedResultHash);
|
||||||
|
await staticCallProxy.transferFrom.awaitTransactionSuccessAsync(assetData, fromAddress, toAddress, amount);
|
||||||
|
});
|
||||||
it('should be successful if a function call with one static input returns the correct value', async () => {
|
it('should be successful if a function call with one static input returns the correct value', async () => {
|
||||||
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(1));
|
const staticCallData = staticCallTarget.isOddNumber.getABIEncodedTransactionData(new BigNumber(1));
|
||||||
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
|
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
|
||||||
|
@@ -54,6 +54,7 @@ export class ERC1155ProxyWrapper {
|
|||||||
erc1155Artifacts.ERC1155Mintable,
|
erc1155Artifacts.ERC1155Mintable,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const erc1155Wrapper = new Erc1155Wrapper(erc1155Contract, this._provider, this._contractOwnerAddress);
|
const erc1155Wrapper = new Erc1155Wrapper(erc1155Contract, this._provider, this._contractOwnerAddress);
|
||||||
this._dummyTokenWrappers.push(erc1155Wrapper);
|
this._dummyTokenWrappers.push(erc1155Wrapper);
|
||||||
@@ -69,6 +70,7 @@ export class ERC1155ProxyWrapper {
|
|||||||
artifacts.ERC1155Proxy,
|
artifacts.ERC1155Proxy,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||||
return this._proxyContract;
|
return this._proxyContract;
|
||||||
|
@@ -37,6 +37,7 @@ export class ERC20Wrapper {
|
|||||||
erc20Artifacts.DummyERC20Token,
|
erc20Artifacts.DummyERC20Token,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
decimals,
|
decimals,
|
||||||
@@ -51,6 +52,7 @@ export class ERC20Wrapper {
|
|||||||
artifacts.ERC20Proxy,
|
artifacts.ERC20Proxy,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||||
return this._proxyContract;
|
return this._proxyContract;
|
||||||
|
@@ -29,6 +29,7 @@ export class ERC721Wrapper {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
),
|
),
|
||||||
@@ -41,6 +42,7 @@ export class ERC721Wrapper {
|
|||||||
artifacts.ERC721Proxy,
|
artifacts.ERC721Proxy,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||||
return this._proxyContract;
|
return this._proxyContract;
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "2.0.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "2.0.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "2.0.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "2.0.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "2.0.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564607468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "2.0.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "2.0.7",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "2.0.6",
|
"version": "2.0.6",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v2.0.13 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.0.12 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.0.11 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.0.10 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.0.9 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v2.0.8 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.0.7 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v2.0.6 - _July 13, 2019_
|
## v2.0.6 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Coordinator
|
## Coordinator
|
||||||
|
|
||||||
This package contains a contract that allows users to call arbitrary functions on the Exchange contract with permission from one or more Coordinators. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains a contract that allows users to call arbitrary functions on the Exchange contract with permission from one or more Coordinators. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-coordinator --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-coordinator",
|
"name": "@0x/contracts-coordinator",
|
||||||
"version": "2.0.6",
|
"version": "2.0.13",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,18 +69,18 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.2.1",
|
"@0x/contracts-asset-proxy": "^2.2.8",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-exchange": "^2.1.7",
|
"@0x/contracts-exchange": "^2.1.14",
|
||||||
"@0x/contracts-exchange-libs": "^3.0.1",
|
"@0x/contracts-exchange-libs": "^3.0.8",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"ethereumjs-util": "^5.1.1",
|
"ethereumjs-util": "^5.1.1",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
|
@@ -74,6 +74,7 @@ describe('Coordinator tests', () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -91,6 +92,7 @@ describe('Coordinator tests', () => {
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ describe('Libs tests', () => {
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeAddress,
|
exchangeAddress,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -44,6 +44,7 @@ describe('Mixins tests', () => {
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeAddress,
|
exchangeAddress,
|
||||||
);
|
);
|
||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
@@ -103,8 +104,7 @@ describe('Mixins tests', () => {
|
|||||||
transaction.signature.length - 2,
|
transaction.signature.length - 2,
|
||||||
)}${illegalSignatureByte}`;
|
)}${illegalSignatureByte}`;
|
||||||
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
||||||
expectContractCallFailedAsync(
|
expect(mixins.getSignerAddress.callAsync(transactionHash, transaction.signature)).to.be.rejectedWith(
|
||||||
mixins.getSignerAddress.callAsync(transactionHash, transaction.signature),
|
|
||||||
RevertReason.SignatureIllegal,
|
RevertReason.SignatureIllegal,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -114,8 +114,7 @@ describe('Mixins tests', () => {
|
|||||||
const invalidSignatureByte = ethUtil.toBuffer(SignatureType.Invalid).toString('hex');
|
const invalidSignatureByte = ethUtil.toBuffer(SignatureType.Invalid).toString('hex');
|
||||||
transaction.signature = `0x${invalidSignatureByte}`;
|
transaction.signature = `0x${invalidSignatureByte}`;
|
||||||
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
||||||
expectContractCallFailedAsync(
|
expect(mixins.getSignerAddress.callAsync(transactionHash, transaction.signature)).to.be.rejectedWith(
|
||||||
mixins.getSignerAddress.callAsync(transactionHash, transaction.signature),
|
|
||||||
RevertReason.SignatureInvalid,
|
RevertReason.SignatureInvalid,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -128,8 +127,7 @@ describe('Mixins tests', () => {
|
|||||||
transaction.signature.length - 2,
|
transaction.signature.length - 2,
|
||||||
)}${invalidSignatureByte}`;
|
)}${invalidSignatureByte}`;
|
||||||
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
||||||
expectContractCallFailedAsync(
|
expect(mixins.getSignerAddress.callAsync(transactionHash, transaction.signature)).to.be.rejectedWith(
|
||||||
mixins.getSignerAddress.callAsync(transactionHash, transaction.signature),
|
|
||||||
RevertReason.SignatureUnsupported,
|
RevertReason.SignatureUnsupported,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -192,8 +190,7 @@ describe('Mixins tests', () => {
|
|||||||
});
|
});
|
||||||
it('should revert if data is less than 4 bytes long', async () => {
|
it('should revert if data is less than 4 bytes long', async () => {
|
||||||
const data = '0x010203';
|
const data = '0x010203';
|
||||||
await expectContractCallFailedAsync(
|
expect(mixins.decodeOrdersFromFillData.callAsync(data)).to.be.rejectedWith(
|
||||||
mixins.decodeOrdersFromFillData.callAsync(data),
|
|
||||||
RevertReason.LibBytesGreaterOrEqualTo4LengthRequired,
|
RevertReason.LibBytesGreaterOrEqualTo4LengthRequired,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -24,6 +24,7 @@ export class CoordinatorRegistryWrapper {
|
|||||||
artifacts.CoordinatorRegistry,
|
artifacts.CoordinatorRegistry,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
if (this._coordinatorRegistryContract === undefined) {
|
if (this._coordinatorRegistryContract === undefined) {
|
||||||
throw new Error(`Failed to deploy Coordinator Registry contract.`);
|
throw new Error(`Failed to deploy Coordinator Registry contract.`);
|
||||||
|
@@ -1,4 +1,77 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "0.0.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "0.0.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "0.0.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "0.0.7",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1564607468,
|
||||||
|
"version": "0.0.6",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.0.5",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564604963
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "0.0.5",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "0.0.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
|
@@ -5,6 +5,38 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v0.0.10 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v0.0.9 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v0.0.8 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v0.0.7 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v0.0.6 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v0.0.5 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v0.0.5 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v0.0.4 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v0.0.3 - _July 13, 2019_
|
## v0.0.3 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Dev-Utils
|
## Dev-Utils
|
||||||
|
|
||||||
This package implements various utilities for developers. For example, the `DevUtils` contract can query batches of balances or allowances given some `assetData`, can validate batches of orders, and can decode 0x-specific calldata. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package implements various utilities for developers. For example, the `DevUtils` contract can query batches of balances or allowances given some `assetData`, can validate batches of orders, and can decode 0x-specific calldata. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-dev-utils --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-dev-utils",
|
"name": "@0x/contracts-dev-utils",
|
||||||
"version": "0.0.3",
|
"version": "0.0.10",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,21 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contract-wrappers": "^9.1.6",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -69,20 +69,20 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.2.1",
|
"@0x/contracts-asset-proxy": "^2.2.8",
|
||||||
"@0x/contracts-erc1155": "^1.1.8",
|
"@0x/contracts-erc1155": "^1.1.15",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-erc721": "^2.1.8",
|
"@0x/contracts-erc721": "^2.1.15",
|
||||||
"@0x/contracts-exchange": "^2.1.7",
|
"@0x/contracts-exchange": "^2.1.14",
|
||||||
"@0x/contracts-exchange-libs": "^3.0.1",
|
"@0x/contracts-exchange-libs": "^3.0.8",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"ethereumjs-util": "^5.1.1"
|
"ethereumjs-util": "^5.1.1"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -92,6 +92,7 @@ describe('LibAssetData', () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.NULL_BYTES,
|
constants.NULL_BYTES,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -99,26 +100,31 @@ describe('LibAssetData', () => {
|
|||||||
proxyArtifacts.ERC20Proxy,
|
proxyArtifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
|
erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.ERC721Proxy,
|
proxyArtifacts.ERC721Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc1155Proxy = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
erc1155Proxy = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.ERC1155Proxy,
|
proxyArtifacts.ERC1155Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.MultiAssetProxy,
|
proxyArtifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.StaticCallProxy,
|
proxyArtifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address);
|
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address);
|
||||||
@@ -131,6 +137,7 @@ describe('LibAssetData', () => {
|
|||||||
artifacts.LibAssetData,
|
artifacts.LibAssetData,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -138,6 +145,7 @@ describe('LibAssetData', () => {
|
|||||||
proxyArtifacts.TestStaticCallTarget,
|
proxyArtifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
[tokenOwnerAddress] = await web3Wrapper.getAvailableAddressesAsync();
|
[tokenOwnerAddress] = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
@@ -146,6 +154,7 @@ describe('LibAssetData', () => {
|
|||||||
erc20Artifacts.DummyERC20Token,
|
erc20Artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
'Dummy',
|
'Dummy',
|
||||||
'DUM',
|
'DUM',
|
||||||
new BigNumber(1),
|
new BigNumber(1),
|
||||||
@@ -156,6 +165,7 @@ describe('LibAssetData', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
'Dummy',
|
'Dummy',
|
||||||
'DUM',
|
'DUM',
|
||||||
);
|
);
|
||||||
@@ -172,6 +182,7 @@ describe('LibAssetData', () => {
|
|||||||
erc1155Artifacts.ERC1155Mintable,
|
erc1155Artifacts.ERC1155Mintable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
const logDecoder = new LogDecoder(web3Wrapper, erc1155Artifacts);
|
const logDecoder = new LogDecoder(web3Wrapper, erc1155Artifacts);
|
||||||
|
@@ -37,6 +37,7 @@ describe('LibTransactionDecoder', () => {
|
|||||||
artifacts.LibTransactionDecoder,
|
artifacts.LibTransactionDecoder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@@ -83,6 +83,7 @@ describe('OrderValidationUtils', () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ describe('OrderValidationUtils', () => {
|
|||||||
proxyArtifacts.MultiAssetProxy,
|
proxyArtifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
const exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
|
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
|
||||||
@@ -102,6 +104,7 @@ describe('OrderValidationUtils', () => {
|
|||||||
artifacts.DevUtils,
|
artifacts.DevUtils,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "1.1.15",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "1.1.14",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "1.1.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "1.1.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "1.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564604963
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "1.1.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "1.1.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "1.1.8",
|
"version": "1.1.8",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v1.1.15 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v1.1.14 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v1.1.13 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v1.1.12 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v1.1.11 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v1.1.10 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v1.1.9 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v1.1.8 - _July 13, 2019_
|
## v1.1.8 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## ERC1155 Tokens
|
## ERC1155 Tokens
|
||||||
|
|
||||||
This package contains implementations of various [ERC1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md) tokens. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains implementations of various [ERC1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md) tokens. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-erc1155 --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-erc1155",
|
"name": "@0x/contracts-erc1155",
|
||||||
"version": "1.1.8",
|
"version": "1.1.15",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,19 +47,20 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -67,14 +68,14 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -60,11 +60,13 @@ describe('ERC1155Token', () => {
|
|||||||
artifacts.ERC1155Mintable,
|
artifacts.ERC1155Mintable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc1155Receiver = await DummyERC1155ReceiverContract.deployFrom0xArtifactAsync(
|
erc1155Receiver = await DummyERC1155ReceiverContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.DummyERC1155Receiver,
|
artifacts.DummyERC1155Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
receiver = erc1155Receiver.address;
|
receiver = erc1155Receiver.address;
|
||||||
// create wrapper & mint erc1155 tokens
|
// create wrapper & mint erc1155 tokens
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "2.2.14",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "2.2.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "2.2.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "2.2.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "2.2.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564604963
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "2.2.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "2.2.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "2.2.7",
|
"version": "2.2.7",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v2.2.14 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.13 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.12 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.11 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.10 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v2.2.9 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.2.8 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v2.2.7 - _July 13, 2019_
|
## v2.2.7 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## ERC20 Tokens
|
## ERC20 Tokens
|
||||||
|
|
||||||
This package contains implementations of various [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) tokens, including WETH (Wrapped Ether) and ZRX. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains implementations of various [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) tokens, including WETH (Wrapped Ether) and ZRX. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-erc20 --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-erc20",
|
"name": "@0x/contracts-erc20",
|
||||||
"version": "2.2.7",
|
"version": "2.2.14",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,13 +69,13 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -37,6 +37,7 @@ describe('UnlimitedAllowanceToken', () => {
|
|||||||
artifacts.DummyERC20Token,
|
artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
|
@@ -33,10 +33,15 @@ describe('EtherToken', () => {
|
|||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
account = accounts[0];
|
account = accounts[0];
|
||||||
|
|
||||||
etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, {
|
etherToken = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
gasPrice,
|
artifacts.WETH9,
|
||||||
...txDefaults,
|
provider,
|
||||||
});
|
{
|
||||||
|
gasPrice,
|
||||||
|
...txDefaults,
|
||||||
|
},
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
|
@@ -26,7 +26,12 @@ describe('ZRXToken', () => {
|
|||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
owner = accounts[0];
|
owner = accounts[0];
|
||||||
spender = accounts[1];
|
spender = accounts[1];
|
||||||
zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRXToken, provider, txDefaults);
|
zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.ZRXToken,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
MAX_UINT = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
MAX_UINT = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "2.1.15",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "2.1.14",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "2.1.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "2.1.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "2.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564604963
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "2.1.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "2.1.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "2.1.8",
|
"version": "2.1.8",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v2.1.15 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.14 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.13 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.12 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.11 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v2.1.10 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.9 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v2.1.8 - _July 13, 2019_
|
## v2.1.8 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## ERC721 Tokens
|
## ERC721 Tokens
|
||||||
|
|
||||||
This package contains implementations of various [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) tokens. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains implementations of various [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) tokens. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-erc721 --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-erc721",
|
"name": "@0x/contracts-erc721",
|
||||||
"version": "2.1.8",
|
"version": "2.1.15",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,13 +69,13 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -48,6 +48,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -55,6 +56,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Receiver,
|
artifacts.DummyERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
logDecoder = new LogDecoder(web3Wrapper, artifacts);
|
logDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
@@ -176,6 +178,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -190,6 +193,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.InvalidERC721Receiver,
|
artifacts.InvalidERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const from = owner;
|
const from = owner;
|
||||||
const to = invalidErc721Receiver.address;
|
const to = invalidErc721Receiver.address;
|
||||||
@@ -237,6 +241,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -251,6 +256,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.InvalidERC721Receiver,
|
artifacts.InvalidERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const from = owner;
|
const from = owner;
|
||||||
const to = invalidErc721Receiver.address;
|
const to = invalidErc721Receiver.address;
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "3.0.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "3.0.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "3.0.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "3.0.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "3.0.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564607468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "3.0.7",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "3.0.6",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "3.0.5",
|
"version": "3.0.5",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v3.0.12 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.11 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.10 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.9 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.8 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v3.0.7 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.6 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v3.0.5 - _July 13, 2019_
|
## v3.0.5 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Exchange Forwarder
|
## Exchange Forwarder
|
||||||
|
|
||||||
This package contains the implementation of the [`Forwarder`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md) contract. This contract is intended to improve the UX of interacting with the 0x [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract by abstracting user approvals, converting ETH to WETH, and paying fees. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains the implementation of the [`Forwarder`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md) contract. This contract is intended to improve the UX of interacting with the 0x [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract by abstracting user approvals, converting ETH to WETH, and paying fees. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-exchange-forwarder --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-exchange-forwarder",
|
"name": "@0x/contracts-exchange-forwarder",
|
||||||
"version": "3.0.5",
|
"version": "3.0.12",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||||
@@ -46,21 +46,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contract-wrappers": "^9.1.6",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,19 +68,19 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.2.1",
|
"@0x/contracts-asset-proxy": "^2.2.8",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-erc721": "^2.1.8",
|
"@0x/contracts-erc721": "^2.1.15",
|
||||||
"@0x/contracts-exchange": "^2.1.7",
|
"@0x/contracts-exchange": "^2.1.14",
|
||||||
"@0x/contracts-exchange-libs": "^3.0.1",
|
"@0x/contracts-exchange-libs": "^3.0.8",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -32,6 +32,7 @@ const DECIMALS_DEFAULT = 18;
|
|||||||
const MAX_WETH_FILL_PERCENTAGE = 95;
|
const MAX_WETH_FILL_PERCENTAGE = 95;
|
||||||
|
|
||||||
describe(ContractName.Forwarder, () => {
|
describe(ContractName.Forwarder, () => {
|
||||||
|
const dependencyArtifacts = { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts };
|
||||||
let makerAddress: string;
|
let makerAddress: string;
|
||||||
let owner: string;
|
let owner: string;
|
||||||
let takerAddress: string;
|
let takerAddress: string;
|
||||||
@@ -88,7 +89,12 @@ describe(ContractName.Forwarder, () => {
|
|||||||
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
||||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||||
|
|
||||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults);
|
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
|
erc20Artifacts.WETH9,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
|
);
|
||||||
weth = new DummyERC20TokenContract(wethContract.address, provider);
|
weth = new DummyERC20TokenContract(wethContract.address, provider);
|
||||||
erc20Wrapper.addDummyTokenContract(weth);
|
erc20Wrapper.addDummyTokenContract(weth);
|
||||||
|
|
||||||
@@ -98,6 +104,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||||
@@ -131,6 +138,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
artifacts.Forwarder,
|
artifacts.Forwarder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
wethAssetData,
|
wethAssetData,
|
||||||
@@ -169,6 +177,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
return expectContractCreationFailedAsync(
|
return expectContractCreationFailedAsync(
|
||||||
@@ -176,6 +185,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
artifacts.Forwarder,
|
artifacts.Forwarder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
wethAssetData,
|
wethAssetData,
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "3.0.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "3.0.7",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "3.0.6",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "3.0.5",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "3.0.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564604963
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "3.0.3",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "3.0.2",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v3.0.8 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.7 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.6 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.5 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.4 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v3.0.3 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.0.2 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v3.0.1 - _July 13, 2019_
|
## v3.0.1 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Exchange Libraries
|
## Exchange Libraries
|
||||||
|
|
||||||
This package contains the implementations of various libraries and utilities used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract. These libraries may be useful when creating external contracts that interact with the `Exchange` contract. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains the implementations of various libraries and utilities used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract. These libraries may be useful when creating external contracts that interact with the `Exchange` contract. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-exchange-libs",
|
"name": "@0x/contracts-exchange-libs",
|
||||||
"version": "3.0.1",
|
"version": "3.0.8",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,14 +69,14 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -35,7 +35,7 @@ describe('Exchange libs', () => {
|
|||||||
before(async () => {
|
before(async () => {
|
||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
const makerAddress = accounts[0];
|
const makerAddress = accounts[0];
|
||||||
libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults);
|
libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults, artifacts);
|
||||||
|
|
||||||
const defaultOrderParams = {
|
const defaultOrderParams = {
|
||||||
...constants.STATIC_ORDER_PARAMS,
|
...constants.STATIC_ORDER_PARAMS,
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "2.1.14",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "2.1.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "2.1.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "2.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "2.1.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564607468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "2.1.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "2.1.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "2.1.7",
|
"version": "2.1.7",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v2.1.14 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.13 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.12 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.11 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.10 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v2.1.9 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v2.1.8 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v2.1.7 - _July 13, 2019_
|
## v2.1.7 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Exchange
|
## Exchange
|
||||||
|
|
||||||
This package contains the implementation of the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange). This contract is responsible for settling trades and is typically the entry point for all transactions that interact with the 0x protocol. Lightweight examples of how external contracts can interct with the `Exchange` contract can be found in the [examples](./contracts/examples) directory. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains the implementation of the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange). This contract is responsible for settling trades and is typically the entry point for all transactions that interact with the 0x protocol. Lightweight examples of how external contracts can interct with the `Exchange` contract can be found in the [examples](./contracts/examples) directory. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-exchange --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ pragma solidity ^0.5.5;
|
|||||||
import "../src/interfaces/IValidator.sol";
|
import "../src/interfaces/IValidator.sol";
|
||||||
|
|
||||||
|
|
||||||
contract Validator is
|
contract Validator is
|
||||||
IValidator
|
IValidator
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ contract Validator is
|
|||||||
/// @param hash Message hash that is signed.
|
/// @param hash Message hash that is signed.
|
||||||
/// @param signerAddress Address that should have signed the given hash.
|
/// @param signerAddress Address that should have signed the given hash.
|
||||||
/// @param signature Proof of signing.
|
/// @param signature Proof of signing.
|
||||||
/// @return Validity of signature.
|
/// @return Returns a known magic value if the signature is valid.
|
||||||
// solhint-disable no-unused-vars
|
// solhint-disable no-unused-vars
|
||||||
function isValidSignature(
|
function isValidSignature(
|
||||||
bytes32 hash,
|
bytes32 hash,
|
||||||
@@ -48,9 +48,11 @@ contract Validator is
|
|||||||
)
|
)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
returns (bool isValid)
|
returns (bytes4)
|
||||||
{
|
{
|
||||||
return (signerAddress == VALID_SIGNER);
|
require(signerAddress == VALID_SIGNER, "INVALID_SIGNER");
|
||||||
|
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||||
|
return magicValue;
|
||||||
}
|
}
|
||||||
// solhint-enable no-unused-vars
|
// solhint-enable no-unused-vars
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ import "../src/interfaces/IWallet.sol";
|
|||||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||||
|
|
||||||
|
|
||||||
contract Wallet is
|
contract Wallet is
|
||||||
IWallet
|
IWallet
|
||||||
{
|
{
|
||||||
using LibBytes for bytes;
|
using LibBytes for bytes;
|
||||||
@@ -41,14 +41,14 @@ contract Wallet is
|
|||||||
/// The signer must match the owner of this wallet.
|
/// The signer must match the owner of this wallet.
|
||||||
/// @param hash Message hash that is signed.
|
/// @param hash Message hash that is signed.
|
||||||
/// @param eip712Signature Proof of signing.
|
/// @param eip712Signature Proof of signing.
|
||||||
/// @return Validity of signature.
|
/// @return Returns a known magic value if the signature is valid.
|
||||||
function isValidSignature(
|
function isValidSignature(
|
||||||
bytes32 hash,
|
bytes32 hash,
|
||||||
bytes calldata eip712Signature
|
bytes calldata eip712Signature
|
||||||
)
|
)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
returns (bool isValid)
|
returns (bytes4)
|
||||||
{
|
{
|
||||||
require(
|
require(
|
||||||
eip712Signature.length == 65,
|
eip712Signature.length == 65,
|
||||||
@@ -59,7 +59,8 @@ contract Wallet is
|
|||||||
bytes32 r = eip712Signature.readBytes32(1);
|
bytes32 r = eip712Signature.readBytes32(1);
|
||||||
bytes32 s = eip712Signature.readBytes32(33);
|
bytes32 s = eip712Signature.readBytes32(33);
|
||||||
address recoveredAddress = ecrecover(hash, v, r, s);
|
address recoveredAddress = ecrecover(hash, v, r, s);
|
||||||
isValid = WALLET_OWNER == recoveredAddress;
|
require(WALLET_OWNER == recoveredAddress, "INVALID_SIGNATURE");
|
||||||
return isValid;
|
bytes4 magicValue = bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"));
|
||||||
|
return magicValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -73,10 +73,12 @@ contract Whitelist is
|
|||||||
)
|
)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
returns (bool isValid)
|
returns (bytes4)
|
||||||
{
|
{
|
||||||
// solhint-disable-next-line avoid-tx-origin
|
// solhint-disable-next-line avoid-tx-origin
|
||||||
return signerAddress == tx.origin;
|
require(signerAddress == tx.origin, "INVALID_SIGNER");
|
||||||
|
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||||
|
return magicValue;
|
||||||
}
|
}
|
||||||
// solhint-enable no-unused-vars
|
// solhint-enable no-unused-vars
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ contract MixinSignatureValidator is
|
|||||||
MTransactions
|
MTransactions
|
||||||
{
|
{
|
||||||
using LibBytes for bytes;
|
using LibBytes for bytes;
|
||||||
|
|
||||||
// Mapping of hash => signer => signed
|
// Mapping of hash => signer => signed
|
||||||
mapping (bytes32 => mapping (address => bool)) public preSigned;
|
mapping (bytes32 => mapping (address => bool)) public preSigned;
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ contract MixinSignatureValidator is
|
|||||||
} else if (signatureType == SignatureType.Validator) {
|
} else if (signatureType == SignatureType.Validator) {
|
||||||
// Pop last 20 bytes off of signature byte array.
|
// Pop last 20 bytes off of signature byte array.
|
||||||
address validatorAddress = signature.popLast20Bytes();
|
address validatorAddress = signature.popLast20Bytes();
|
||||||
|
|
||||||
// Ensure signer has approved validator.
|
// Ensure signer has approved validator.
|
||||||
if (!allowedValidators[signerAddress][validatorAddress]) {
|
if (!allowedValidators[signerAddress][validatorAddress]) {
|
||||||
return false;
|
return false;
|
||||||
@@ -224,7 +224,8 @@ contract MixinSignatureValidator is
|
|||||||
revert("SIGNATURE_UNSUPPORTED");
|
revert("SIGNATURE_UNSUPPORTED");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Verifies signature using logic defined by Wallet contract.
|
/// @dev Verifies signature using logic defined by Wallet contract. Wallet contract
|
||||||
|
/// must return `bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))`
|
||||||
/// @param hash Any 32 byte hash.
|
/// @param hash Any 32 byte hash.
|
||||||
/// @param walletAddress Address that should have signed the given hash
|
/// @param walletAddress Address that should have signed the given hash
|
||||||
/// and defines its own signature verification method.
|
/// and defines its own signature verification method.
|
||||||
@@ -244,7 +245,19 @@ contract MixinSignatureValidator is
|
|||||||
hash,
|
hash,
|
||||||
signature
|
signature
|
||||||
);
|
);
|
||||||
|
// bytes4 0xb0671381
|
||||||
|
bytes32 magicValue = bytes32(bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)")));
|
||||||
assembly {
|
assembly {
|
||||||
|
// extcodesize added as an extra safety measure
|
||||||
|
if iszero(extcodesize(walletAddress)) {
|
||||||
|
// Revert with `Error("WALLET_ERROR")`
|
||||||
|
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||||
|
mstore(96, 0)
|
||||||
|
revert(0, 100)
|
||||||
|
}
|
||||||
|
|
||||||
let cdStart := add(callData, 32)
|
let cdStart := add(callData, 32)
|
||||||
let success := staticcall(
|
let success := staticcall(
|
||||||
gas, // forward all gas
|
gas, // forward all gas
|
||||||
@@ -255,6 +268,15 @@ contract MixinSignatureValidator is
|
|||||||
32 // output size is 32 bytes
|
32 // output size is 32 bytes
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if iszero(eq(returndatasize(), 32)) {
|
||||||
|
// Revert with `Error("WALLET_ERROR")`
|
||||||
|
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||||
|
mstore(96, 0)
|
||||||
|
revert(0, 100)
|
||||||
|
}
|
||||||
|
|
||||||
switch success
|
switch success
|
||||||
case 0 {
|
case 0 {
|
||||||
// Revert with `Error("WALLET_ERROR")`
|
// Revert with `Error("WALLET_ERROR")`
|
||||||
@@ -266,13 +288,17 @@ contract MixinSignatureValidator is
|
|||||||
}
|
}
|
||||||
case 1 {
|
case 1 {
|
||||||
// Signature is valid if call did not revert and returned true
|
// Signature is valid if call did not revert and returned true
|
||||||
isValid := mload(cdStart)
|
isValid := eq(
|
||||||
|
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||||
|
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Verifies signature using logic defined by Validator contract.
|
/// @dev Verifies signature using logic defined by Validator contract.
|
||||||
|
/// Validator must return `bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))`
|
||||||
/// @param validatorAddress Address of validator contract.
|
/// @param validatorAddress Address of validator contract.
|
||||||
/// @param hash Any 32 byte hash.
|
/// @param hash Any 32 byte hash.
|
||||||
/// @param signerAddress Address that should have signed the given hash.
|
/// @param signerAddress Address that should have signed the given hash.
|
||||||
@@ -294,7 +320,19 @@ contract MixinSignatureValidator is
|
|||||||
signerAddress,
|
signerAddress,
|
||||||
signature
|
signature
|
||||||
);
|
);
|
||||||
|
// bytes4 0x42b38674
|
||||||
|
bytes32 magicValue = bytes32(bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)")));
|
||||||
assembly {
|
assembly {
|
||||||
|
// extcodesize added as an extra safety measure
|
||||||
|
if iszero(extcodesize(validatorAddress)) {
|
||||||
|
// Revert with `Error("VALIDATOR_ERROR")`
|
||||||
|
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||||
|
mstore(96, 0)
|
||||||
|
revert(0, 100)
|
||||||
|
}
|
||||||
|
|
||||||
let cdStart := add(callData, 32)
|
let cdStart := add(callData, 32)
|
||||||
let success := staticcall(
|
let success := staticcall(
|
||||||
gas, // forward all gas
|
gas, // forward all gas
|
||||||
@@ -305,6 +343,15 @@ contract MixinSignatureValidator is
|
|||||||
32 // output size is 32 bytes
|
32 // output size is 32 bytes
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if iszero(eq(returndatasize(), 32)) {
|
||||||
|
// Revert with `Error("VALIDATOR_ERROR")`
|
||||||
|
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||||
|
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||||
|
mstore(96, 0)
|
||||||
|
revert(0, 100)
|
||||||
|
}
|
||||||
|
|
||||||
switch success
|
switch success
|
||||||
case 0 {
|
case 0 {
|
||||||
// Revert with `Error("VALIDATOR_ERROR")`
|
// Revert with `Error("VALIDATOR_ERROR")`
|
||||||
@@ -316,7 +363,10 @@ contract MixinSignatureValidator is
|
|||||||
}
|
}
|
||||||
case 1 {
|
case 1 {
|
||||||
// Signature is valid if call did not revert and returned true
|
// Signature is valid if call did not revert and returned true
|
||||||
isValid := mload(cdStart)
|
isValid := eq(
|
||||||
|
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||||
|
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isValid;
|
return isValid;
|
||||||
|
@@ -25,7 +25,8 @@ contract IValidator {
|
|||||||
/// @param hash Message hash that is signed.
|
/// @param hash Message hash that is signed.
|
||||||
/// @param signerAddress Address that should have signed the given hash.
|
/// @param signerAddress Address that should have signed the given hash.
|
||||||
/// @param signature Proof of signing.
|
/// @param signature Proof of signing.
|
||||||
/// @return Validity of order signature.
|
/// @return Magic bytes4 value if the signature is valid.
|
||||||
|
/// Magic value is bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))
|
||||||
function isValidSignature(
|
function isValidSignature(
|
||||||
bytes32 hash,
|
bytes32 hash,
|
||||||
address signerAddress,
|
address signerAddress,
|
||||||
@@ -33,5 +34,5 @@ contract IValidator {
|
|||||||
)
|
)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
returns (bool isValid);
|
returns (bytes4);
|
||||||
}
|
}
|
||||||
|
@@ -24,12 +24,13 @@ contract IWallet {
|
|||||||
/// @dev Verifies that a signature is valid.
|
/// @dev Verifies that a signature is valid.
|
||||||
/// @param hash Message hash that is signed.
|
/// @param hash Message hash that is signed.
|
||||||
/// @param signature Proof of signing.
|
/// @param signature Proof of signing.
|
||||||
/// @return Validity of order signature.
|
/// @return Magic bytes4 value if the signature is valid.
|
||||||
|
/// Magic value is bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))
|
||||||
function isValidSignature(
|
function isValidSignature(
|
||||||
bytes32 hash,
|
bytes32 hash,
|
||||||
bytes calldata signature
|
bytes calldata signature
|
||||||
)
|
)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
returns (bool isValid);
|
returns (bytes4);
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-exchange",
|
"name": "@0x/contracts-exchange",
|
||||||
"version": "2.1.7",
|
"version": "2.1.14",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,19 +69,19 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.2.1",
|
"@0x/contracts-asset-proxy": "^2.2.8",
|
||||||
"@0x/contracts-erc1155": "^1.1.8",
|
"@0x/contracts-erc1155": "^1.1.15",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-erc721": "^2.1.8",
|
"@0x/contracts-erc721": "^2.1.15",
|
||||||
"@0x/contracts-exchange-libs": "^3.0.1",
|
"@0x/contracts-exchange-libs": "^3.0.8",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"ethereumjs-util": "^5.1.1",
|
"ethereumjs-util": "^5.1.1",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
artifacts as proxyArtifacts,
|
artifacts as proxyArtifacts,
|
||||||
|
ERC1155ProxyContract,
|
||||||
ERC1155ProxyWrapper,
|
ERC1155ProxyWrapper,
|
||||||
ERC20ProxyContract,
|
ERC20ProxyContract,
|
||||||
ERC20Wrapper,
|
ERC20Wrapper,
|
||||||
@@ -50,6 +51,8 @@ import {
|
|||||||
TestStaticCallReceiverContract,
|
TestStaticCallReceiverContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -69,7 +72,7 @@ describe('Exchange core', () => {
|
|||||||
let exchange: ExchangeContract;
|
let exchange: ExchangeContract;
|
||||||
let erc20Proxy: ERC20ProxyContract;
|
let erc20Proxy: ERC20ProxyContract;
|
||||||
let erc721Proxy: ERC721ProxyContract;
|
let erc721Proxy: ERC721ProxyContract;
|
||||||
let erc1155Proxy: ERC721ProxyContract;
|
let erc1155Proxy: ERC1155ProxyContract;
|
||||||
let multiAssetProxy: MultiAssetProxyContract;
|
let multiAssetProxy: MultiAssetProxyContract;
|
||||||
let staticCallProxy: StaticCallProxyContract;
|
let staticCallProxy: StaticCallProxyContract;
|
||||||
let staticCallTarget: TestStaticCallTargetContract;
|
let staticCallTarget: TestStaticCallTargetContract;
|
||||||
@@ -116,11 +119,13 @@ describe('Exchange core', () => {
|
|||||||
proxyArtifacts.MultiAssetProxy,
|
proxyArtifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.StaticCallProxy,
|
proxyArtifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
const numDummyErc20ToDeploy = 3;
|
const numDummyErc20ToDeploy = 3;
|
||||||
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
|
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
|
||||||
@@ -135,17 +140,20 @@ describe('Exchange core', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallReceiver,
|
artifacts.TestStaticCallReceiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
|
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ReentrantERC20Token,
|
artifacts.ReentrantERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -348,6 +356,7 @@ describe('Exchange core', () => {
|
|||||||
erc20Artifacts.DummyNoReturnERC20Token,
|
erc20Artifacts.DummyNoReturnERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
@@ -1473,6 +1482,7 @@ describe('Exchange core', () => {
|
|||||||
proxyArtifacts.TestStaticCallTarget,
|
proxyArtifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if the staticcall is unsuccessful', async () => {
|
it('should revert if the staticcall is unsuccessful', async () => {
|
||||||
|
@@ -29,6 +29,8 @@ import {
|
|||||||
TestAssetProxyDispatcherContract,
|
TestAssetProxyDispatcherContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -72,6 +74,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
artifacts.TestAssetProxyDispatcher,
|
artifacts.TestAssetProxyDispatcher,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, {
|
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, {
|
||||||
@@ -134,6 +137,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
proxyArtifacts.ERC20Proxy,
|
proxyArtifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
// Register new ERC20 Transfer Proxy contract
|
// Register new ERC20 Transfer Proxy contract
|
||||||
return expectTransactionFailedAsync(
|
return expectTransactionFailedAsync(
|
||||||
|
@@ -18,6 +18,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { artifacts, TestExchangeInternalsContract } from '../src';
|
import { artifacts, TestExchangeInternalsContract } from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ describe('Exchange core internal functions', () => {
|
|||||||
artifacts.TestExchangeInternals,
|
artifacts.TestExchangeInternals,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
overflowErrorForSendTransaction = new Error(
|
overflowErrorForSendTransaction = new Error(
|
||||||
await getRevertReasonOrErrorMessageForSendTransactionAsync(RevertReason.Uint256Overflow),
|
await getRevertReasonOrErrorMessageForSendTransactionAsync(RevertReason.Uint256Overflow),
|
||||||
|
@@ -29,6 +29,8 @@ import {
|
|||||||
TestExchangeInternalsContract,
|
TestExchangeInternalsContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
@@ -118,6 +120,7 @@ describe('matchOrders', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -141,6 +144,7 @@ describe('matchOrders', () => {
|
|||||||
artifacts.ReentrantERC20Token,
|
artifacts.ReentrantERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -175,6 +179,7 @@ describe('matchOrders', () => {
|
|||||||
artifacts.TestExchangeInternals,
|
artifacts.TestExchangeInternals,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -25,6 +25,8 @@ import {
|
|||||||
WalletContract,
|
WalletContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
@@ -59,23 +61,27 @@ describe('MixinSignatureValidator', () => {
|
|||||||
artifacts.TestSignatureValidator,
|
artifacts.TestSignatureValidator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
testWallet = await WalletContract.deployFrom0xArtifactAsync(
|
testWallet = await WalletContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Wallet,
|
artifacts.Wallet,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
signerAddress,
|
signerAddress,
|
||||||
);
|
);
|
||||||
testValidator = await ValidatorContract.deployFrom0xArtifactAsync(
|
testValidator = await ValidatorContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Validator,
|
artifacts.Validator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
signerAddress,
|
signerAddress,
|
||||||
);
|
);
|
||||||
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallReceiver,
|
artifacts.TestStaticCallReceiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts);
|
signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
@@ -94,6 +100,12 @@ describe('MixinSignatureValidator', () => {
|
|||||||
),
|
),
|
||||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||||
);
|
);
|
||||||
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
|
await signatureValidator.setSignatureValidatorApproval.sendTransactionAsync(testValidator.address, true, {
|
||||||
|
from: notSignerAddress,
|
||||||
|
}),
|
||||||
|
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||||
|
);
|
||||||
|
|
||||||
const defaultOrderParams = {
|
const defaultOrderParams = {
|
||||||
...constants.STATIC_ORDER_PARAMS,
|
...constants.STATIC_ORDER_PARAMS,
|
||||||
@@ -301,7 +313,7 @@ describe('MixinSignatureValidator', () => {
|
|||||||
expect(isValidSignature).to.be.true();
|
expect(isValidSignature).to.be.true();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false when SignatureType=Wallet and signature is invalid', async () => {
|
it('should revert when SignatureType=Wallet and signature is invalid', async () => {
|
||||||
// Create EIP712 signature using a private key that does not belong to the wallet owner.
|
// Create EIP712 signature using a private key that does not belong to the wallet owner.
|
||||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
const orderHashBuffer = ethUtil.toBuffer(orderHashHex);
|
const orderHashBuffer = ethUtil.toBuffer(orderHashHex);
|
||||||
@@ -316,12 +328,10 @@ describe('MixinSignatureValidator', () => {
|
|||||||
]);
|
]);
|
||||||
const signatureHex = ethUtil.bufferToHex(signature);
|
const signatureHex = ethUtil.bufferToHex(signature);
|
||||||
// Validate signature
|
// Validate signature
|
||||||
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
|
return expectContractCallFailedAsync(
|
||||||
orderHashHex,
|
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, testWallet.address, signatureHex),
|
||||||
testWallet.address,
|
RevertReason.WalletError,
|
||||||
signatureHex,
|
|
||||||
);
|
);
|
||||||
expect(isValidSignature).to.be.false();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should revert when `isValidSignature` attempts to update state and SignatureType=Wallet', async () => {
|
it('should revert when `isValidSignature` attempts to update state and SignatureType=Wallet', async () => {
|
||||||
@@ -359,6 +369,15 @@ describe('MixinSignatureValidator', () => {
|
|||||||
signatureHex,
|
signatureHex,
|
||||||
);
|
);
|
||||||
expect(isValidSignature).to.be.true();
|
expect(isValidSignature).to.be.true();
|
||||||
|
|
||||||
|
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
|
||||||
|
provider,
|
||||||
|
orderHashHex,
|
||||||
|
signatureHex,
|
||||||
|
signerAddress,
|
||||||
|
signatureValidator.address,
|
||||||
|
);
|
||||||
|
expect(isValidSignatureTs).to.be.true();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false when SignatureType=Validator, signature is invalid and validator is approved', async () => {
|
it('should return false when SignatureType=Validator, signature is invalid and validator is approved', async () => {
|
||||||
@@ -369,12 +388,19 @@ describe('MixinSignatureValidator', () => {
|
|||||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
// This will return false because we signed the message with `signerAddress`, but
|
// This will return false because we signed the message with `signerAddress`, but
|
||||||
// are validating against `notSignerAddress`
|
// are validating against `notSignerAddress`
|
||||||
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
|
await expectContractCallFailedAsync(
|
||||||
orderHashHex,
|
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, notSignerAddress, signatureHex),
|
||||||
notSignerAddress,
|
RevertReason.ValidatorError,
|
||||||
signatureHex,
|
|
||||||
);
|
);
|
||||||
expect(isValidSignature).to.be.false();
|
|
||||||
|
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
|
||||||
|
provider,
|
||||||
|
orderHashHex,
|
||||||
|
signatureHex,
|
||||||
|
notSignerAddress,
|
||||||
|
signatureValidator.address,
|
||||||
|
);
|
||||||
|
expect(isValidSignatureTs).to.be.false();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should revert when `isValidSignature` attempts to update state and SignatureType=Validator', async () => {
|
it('should revert when `isValidSignature` attempts to update state and SignatureType=Validator', async () => {
|
||||||
@@ -410,6 +436,16 @@ describe('MixinSignatureValidator', () => {
|
|||||||
signatureHex,
|
signatureHex,
|
||||||
);
|
);
|
||||||
expect(isValidSignature).to.be.false();
|
expect(isValidSignature).to.be.false();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
signatureUtils.isValidSignatureAsync(
|
||||||
|
provider,
|
||||||
|
orderHashHex,
|
||||||
|
signatureHex,
|
||||||
|
signerAddress,
|
||||||
|
signatureValidator.address,
|
||||||
|
),
|
||||||
|
).to.be.rejected();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true when SignatureType=Presigned and signer has presigned hash', async () => {
|
it('should return true when SignatureType=Presigned and signer has presigned hash', async () => {
|
||||||
|
@@ -21,6 +21,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { artifacts, ExchangeContract, ExchangeWrapper, ExchangeWrapperContract, WhitelistContract } from '../src/';
|
import { artifacts, ExchangeContract, ExchangeWrapper, ExchangeWrapperContract, WhitelistContract } from '../src/';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -87,6 +89,7 @@ describe('Exchange transactions', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -219,6 +222,7 @@ describe('Exchange transactions', () => {
|
|||||||
artifacts.ExchangeWrapper,
|
artifacts.ExchangeWrapper,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -333,6 +337,7 @@ describe('Exchange transactions', () => {
|
|||||||
artifacts.Whitelist,
|
artifacts.Whitelist,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
const isApproved = true;
|
const isApproved = true;
|
||||||
|
9
contracts/exchange/test/utils/dependency_artifacts.ts
Normal file
9
contracts/exchange/test/utils/dependency_artifacts.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
||||||
|
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
||||||
|
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
||||||
|
|
||||||
|
export const dependencyArtifacts = {
|
||||||
|
...erc20Artifacts,
|
||||||
|
...erc721Artifacts,
|
||||||
|
...erc1155Artifacts,
|
||||||
|
};
|
@@ -1,37 +1,21 @@
|
|||||||
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
import { FillResults, formatters, OrderInfo, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils';
|
||||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
|
||||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
|
||||||
import {
|
|
||||||
FillResults,
|
|
||||||
formatters,
|
|
||||||
LogDecoder,
|
|
||||||
OrderInfo,
|
|
||||||
orderUtils,
|
|
||||||
Web3ProviderEngine,
|
|
||||||
} from '@0x/contracts-test-utils';
|
|
||||||
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
||||||
import { AbiEncoder, BigNumber } from '@0x/utils';
|
import { AbiEncoder, BigNumber } from '@0x/utils';
|
||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||||
import { MethodAbi, TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
|
import { MethodAbi, TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { artifacts, ExchangeContract } from '../../src';
|
import { ExchangeContract } from '../../src';
|
||||||
|
|
||||||
import { AbiDecodedFillOrderData } from './types';
|
import { AbiDecodedFillOrderData } from './types';
|
||||||
|
|
||||||
export class ExchangeWrapper {
|
export class ExchangeWrapper {
|
||||||
private readonly _exchange: ExchangeContract;
|
private readonly _exchange: ExchangeContract;
|
||||||
|
// tslint:disable no-unused-variable
|
||||||
private readonly _web3Wrapper: Web3Wrapper;
|
private readonly _web3Wrapper: Web3Wrapper;
|
||||||
private readonly _logDecoder: LogDecoder;
|
|
||||||
constructor(exchangeContract: ExchangeContract, provider: Web3ProviderEngine | ZeroExProvider) {
|
constructor(exchangeContract: ExchangeContract, provider: Web3ProviderEngine | ZeroExProvider) {
|
||||||
this._exchange = exchangeContract;
|
this._exchange = exchangeContract;
|
||||||
this._web3Wrapper = new Web3Wrapper(provider);
|
this._web3Wrapper = new Web3Wrapper(provider);
|
||||||
this._logDecoder = new LogDecoder(this._web3Wrapper, {
|
|
||||||
...artifacts,
|
|
||||||
...erc20Artifacts,
|
|
||||||
...erc721Artifacts,
|
|
||||||
...erc1155Artifacts,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
public async fillOrderAsync(
|
public async fillOrderAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
@@ -39,20 +23,18 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount?: BigNumber } = {},
|
opts: { takerAssetFillAmount?: BigNumber } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.fillOrder.sendTransactionAsync(
|
const txReceipt = await this._exchange.fillOrder.awaitTransactionSuccessAsync(
|
||||||
params.order,
|
params.order,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signature,
|
params.signature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const txReceipt = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
|
||||||
return txReceipt;
|
return txReceipt;
|
||||||
}
|
}
|
||||||
public async cancelOrderAsync(signedOrder: SignedOrder, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
public async cancelOrderAsync(signedOrder: SignedOrder, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createCancel(signedOrder);
|
const params = orderUtils.createCancel(signedOrder);
|
||||||
const txHash = await this._exchange.cancelOrder.sendTransactionAsync(params.order, { from });
|
const txReceipt = await this._exchange.cancelOrder.awaitTransactionSuccessAsync(params.order, { from });
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async fillOrKillOrderAsync(
|
public async fillOrKillOrderAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
@@ -60,14 +42,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount?: BigNumber } = {},
|
opts: { takerAssetFillAmount?: BigNumber } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.fillOrKillOrder.sendTransactionAsync(
|
const txReceipt = await this._exchange.fillOrKillOrder.awaitTransactionSuccessAsync(
|
||||||
params.order,
|
params.order,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signature,
|
params.signature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async fillOrderNoThrowAsync(
|
public async fillOrderNoThrowAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
@@ -75,14 +56,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount?: BigNumber; gas?: number } = {},
|
opts: { takerAssetFillAmount?: BigNumber; gas?: number } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.fillOrderNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.fillOrderNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.order,
|
params.order,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signature,
|
params.signature,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchFillOrdersAsync(
|
public async batchFillOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -90,14 +70,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||||
const txHash = await this._exchange.batchFillOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.batchFillOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmounts,
|
params.takerAssetFillAmounts,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchFillOrKillOrdersAsync(
|
public async batchFillOrKillOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -105,14 +84,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||||
const txHash = await this._exchange.batchFillOrKillOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.batchFillOrKillOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmounts,
|
params.takerAssetFillAmounts,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchFillOrdersNoThrowAsync(
|
public async batchFillOrdersNoThrowAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -120,14 +98,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmounts?: BigNumber[]; gas?: number } = {},
|
opts: { takerAssetFillAmounts?: BigNumber[]; gas?: number } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||||
const txHash = await this._exchange.batchFillOrdersNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.batchFillOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmounts,
|
params.takerAssetFillAmounts,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketSellOrdersAsync(
|
public async marketSellOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -135,14 +112,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount: BigNumber },
|
opts: { takerAssetFillAmount: BigNumber },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketSellOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketSellOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketSellOrdersNoThrowAsync(
|
public async marketSellOrdersNoThrowAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -150,14 +126,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount: BigNumber; gas?: number },
|
opts: { takerAssetFillAmount: BigNumber; gas?: number },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketSellOrdersNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketSellOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketBuyOrdersAsync(
|
public async marketBuyOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -165,14 +140,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { makerAssetFillAmount: BigNumber },
|
opts: { makerAssetFillAmount: BigNumber },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketBuyOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketBuyOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.makerAssetFillAmount,
|
params.makerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketBuyOrdersNoThrowAsync(
|
public async marketBuyOrdersNoThrowAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -180,50 +154,47 @@ export class ExchangeWrapper {
|
|||||||
opts: { makerAssetFillAmount: BigNumber; gas?: number },
|
opts: { makerAssetFillAmount: BigNumber; gas?: number },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketBuyOrdersNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketBuyOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.makerAssetFillAmount,
|
params.makerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchCancelOrdersAsync(
|
public async batchCancelOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchCancel(orders);
|
const params = formatters.createBatchCancel(orders);
|
||||||
const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(params.orders, { from });
|
const txReceipt = await this._exchange.batchCancelOrders.awaitTransactionSuccessAsync(params.orders, { from });
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async cancelOrdersUpToAsync(salt: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
public async cancelOrdersUpToAsync(salt: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const txHash = await this._exchange.cancelOrdersUpTo.sendTransactionAsync(salt, { from });
|
const txReceipt = await this._exchange.cancelOrdersUpTo.awaitTransactionSuccessAsync(salt, { from });
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async registerAssetProxyAsync(
|
public async registerAssetProxyAsync(
|
||||||
assetProxyAddress: string,
|
assetProxyAddress: string,
|
||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync(assetProxyAddress, { from });
|
const txReceipt = await this._exchange.registerAssetProxy.awaitTransactionSuccessAsync(assetProxyAddress, {
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
from,
|
||||||
return tx;
|
});
|
||||||
|
return txReceipt;
|
||||||
}
|
}
|
||||||
public async executeTransactionAsync(
|
public async executeTransactionAsync(
|
||||||
signedTx: SignedZeroExTransaction,
|
signedTx: SignedZeroExTransaction,
|
||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const txHash = await this._exchange.executeTransaction.sendTransactionAsync(
|
const txReceipt = await this._exchange.executeTransaction.awaitTransactionSuccessAsync(
|
||||||
signedTx.salt,
|
signedTx.salt,
|
||||||
signedTx.signerAddress,
|
signedTx.signerAddress,
|
||||||
signedTx.data,
|
signedTx.data,
|
||||||
signedTx.signature,
|
signedTx.signature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
|
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
|
||||||
const filledAmount = await this._exchange.filled.callAsync(orderHashHex);
|
const filledAmount = await this._exchange.filled.callAsync(orderHashHex);
|
||||||
@@ -251,15 +222,14 @@ export class ExchangeWrapper {
|
|||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createMatchOrders(signedOrderLeft, signedOrderRight);
|
const params = orderUtils.createMatchOrders(signedOrderLeft, signedOrderRight);
|
||||||
const txHash = await this._exchange.matchOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.matchOrders.awaitTransactionSuccessAsync(
|
||||||
params.left,
|
params.left,
|
||||||
params.right,
|
params.right,
|
||||||
params.leftSignature,
|
params.leftSignature,
|
||||||
params.rightSignature,
|
params.rightSignature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async getFillOrderResultsAsync(
|
public async getFillOrderResultsAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
|
@@ -37,6 +37,7 @@ import 'make-promises-safe';
|
|||||||
import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src';
|
import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src';
|
||||||
|
|
||||||
import { AssetWrapper } from './asset_wrapper';
|
import { AssetWrapper } from './asset_wrapper';
|
||||||
|
import { dependencyArtifacts } from './dependency_artifacts';
|
||||||
import { ExchangeWrapper } from './exchange_wrapper';
|
import { ExchangeWrapper } from './exchange_wrapper';
|
||||||
import { OrderFactoryFromScenario } from './order_factory_from_scenario';
|
import { OrderFactoryFromScenario } from './order_factory_from_scenario';
|
||||||
import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher';
|
import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher';
|
||||||
@@ -101,6 +102,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider);
|
const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider);
|
||||||
@@ -135,6 +137,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
|
|||||||
libsArtifacts.TestLibs,
|
libsArtifacts.TestLibs,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils(
|
const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils(
|
||||||
|
@@ -24,6 +24,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { artifacts, ExchangeContract, ExchangeWrapper, ReentrantERC20TokenContract } from '../src';
|
import { artifacts, ExchangeContract, ExchangeWrapper, ReentrantERC20TokenContract } from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -87,6 +89,7 @@ describe('Exchange wrappers', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -110,6 +113,7 @@ describe('Exchange wrappers', () => {
|
|||||||
artifacts.ReentrantERC20Token,
|
artifacts.ReentrantERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "4.0.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "4.0.7",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "4.0.6",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "4.0.5",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "4.0.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564607468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "4.0.3",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "4.0.2",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v4.0.8 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v4.0.7 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v4.0.6 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v4.0.5 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v4.0.4 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v4.0.3 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v4.0.2 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v4.0.1 - _July 13, 2019_
|
## v4.0.1 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Extensions
|
## Extensions
|
||||||
|
|
||||||
This package implements various extensions to the 0x protocol. Extension contracts can add various rules around how orders are settled while still getting the interoperability and security benefits of using the underlying 0x protocol contracts. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package implements various extensions to the 0x protocol. Extension contracts can add various rules around how orders are settled while still getting the interoperability and security benefits of using the underlying 0x protocol contracts. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-extensions --save
|
|||||||
|
|
||||||
## Bug bounty
|
## Bug bounty
|
||||||
|
|
||||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
pragma solidity ^0.5.5;
|
pragma solidity ^0.5.5;
|
||||||
|
|
||||||
import "@0x/contract-utils/contracts/src/interfaces/IOwnable.sol";
|
import "@0x/contracts-utils/contracts/src/interfaces/IOwnable.sol";
|
||||||
import "./IMatchOrders.sol";
|
import "./IMatchOrders.sol";
|
||||||
import "./IAssets.sol";
|
import "./IAssets.sol";
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-extensions",
|
"name": "@0x/contracts-extensions",
|
||||||
"version": "4.0.1",
|
"version": "4.0.8",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,21 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contract-wrappers": "^9.1.6",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -69,19 +69,19 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.2.1",
|
"@0x/contracts-asset-proxy": "^2.2.8",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-erc721": "^2.1.8",
|
"@0x/contracts-erc721": "^2.1.15",
|
||||||
"@0x/contracts-exchange": "^2.1.7",
|
"@0x/contracts-exchange": "^2.1.14",
|
||||||
"@0x/contracts-exchange-libs": "^3.0.1",
|
"@0x/contracts-exchange-libs": "^3.0.8",
|
||||||
"@0x/contracts-utils": "^3.1.8",
|
"@0x/contracts-utils": "^3.2.4",
|
||||||
"@0x/order-utils": "^8.2.1",
|
"@0x/order-utils": "^8.4.0",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -130,6 +130,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||||
@@ -148,6 +149,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
|||||||
artifacts.BalanceThresholdFilter,
|
artifacts.BalanceThresholdFilter,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
erc721BalanceThresholdAsset.address,
|
erc721BalanceThresholdAsset.address,
|
||||||
erc721alanceThreshold,
|
erc721alanceThreshold,
|
||||||
@@ -157,6 +159,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
|||||||
artifacts.BalanceThresholdFilter,
|
artifacts.BalanceThresholdFilter,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
erc20BalanceThresholdAsset.address,
|
erc20BalanceThresholdAsset.address,
|
||||||
erc20BalanceThreshold,
|
erc20BalanceThreshold,
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
import { DutchAuctionWrapper } from '@0x/contract-wrappers';
|
|
||||||
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
|
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
|
||||||
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
|
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
|
||||||
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||||
@@ -82,7 +81,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
||||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||||
|
|
||||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
|
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults, artifacts);
|
||||||
erc20Wrapper.addDummyTokenContract(wethContract as any);
|
erc20Wrapper.addDummyTokenContract(wethContract as any);
|
||||||
|
|
||||||
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
||||||
@@ -90,6 +89,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
const exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
const exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||||
@@ -107,6 +107,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
artifacts.DutchAuction,
|
artifacts.DutchAuction,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
);
|
);
|
||||||
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
||||||
@@ -149,7 +150,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
feeRecipientAddress,
|
feeRecipientAddress,
|
||||||
// taker address or sender address should be set to the ducth auction contract
|
// taker address or sender address should be set to the ducth auction contract
|
||||||
takerAddress: dutchAuctionContract.address,
|
takerAddress: dutchAuctionContract.address,
|
||||||
makerAssetData: DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
makerAssetData: assetDataUtils.encodeDutchAuctionAssetData(
|
||||||
assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress),
|
assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress),
|
||||||
auctionBeginTimeSeconds,
|
auctionBeginTimeSeconds,
|
||||||
auctionBeginAmount,
|
auctionBeginAmount,
|
||||||
@@ -191,7 +192,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
describe('matchOrders', () => {
|
describe('matchOrders', () => {
|
||||||
it('should be worth the begin price at the begining of the auction', async () => {
|
it('should be worth the begin price at the begining of the auction', async () => {
|
||||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp + 2);
|
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp + 2);
|
||||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||||
defaultERC20MakerAssetData,
|
defaultERC20MakerAssetData,
|
||||||
auctionBeginTimeSeconds,
|
auctionBeginTimeSeconds,
|
||||||
auctionBeginAmount,
|
auctionBeginAmount,
|
||||||
@@ -205,7 +206,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
it('should be be worth the end price at the end of the auction', async () => {
|
it('should be be worth the end price at the end of the auction', async () => {
|
||||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
||||||
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
||||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||||
defaultERC20MakerAssetData,
|
defaultERC20MakerAssetData,
|
||||||
auctionBeginTimeSeconds,
|
auctionBeginTimeSeconds,
|
||||||
auctionBeginAmount,
|
auctionBeginAmount,
|
||||||
@@ -271,7 +272,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
it('should revert when auction expires', async () => {
|
it('should revert when auction expires', async () => {
|
||||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
||||||
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
||||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||||
defaultERC20MakerAssetData,
|
defaultERC20MakerAssetData,
|
||||||
auctionBeginTimeSeconds,
|
auctionBeginTimeSeconds,
|
||||||
auctionBeginAmount,
|
auctionBeginAmount,
|
||||||
@@ -305,7 +306,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
});
|
});
|
||||||
it('begin time is less than end time', async () => {
|
it('begin time is less than end time', async () => {
|
||||||
auctionBeginTimeSeconds = new BigNumber(auctionEndTimeSeconds).plus(tenMinutesInSeconds);
|
auctionBeginTimeSeconds = new BigNumber(auctionEndTimeSeconds).plus(tenMinutesInSeconds);
|
||||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||||
defaultERC20MakerAssetData,
|
defaultERC20MakerAssetData,
|
||||||
auctionBeginTimeSeconds,
|
auctionBeginTimeSeconds,
|
||||||
auctionBeginAmount,
|
auctionBeginAmount,
|
||||||
@@ -333,7 +334,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
it('should match orders when ERC721', async () => {
|
it('should match orders when ERC721', async () => {
|
||||||
const makerAssetId = erc721MakerAssetIds[0];
|
const makerAssetId = erc721MakerAssetIds[0];
|
||||||
const erc721MakerAssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, makerAssetId);
|
const erc721MakerAssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, makerAssetId);
|
||||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||||
erc721MakerAssetData,
|
erc721MakerAssetData,
|
||||||
auctionBeginTimeSeconds,
|
auctionBeginTimeSeconds,
|
||||||
auctionBeginAmount,
|
auctionBeginAmount,
|
||||||
|
@@ -103,12 +103,14 @@ describe('OrderMatcher', () => {
|
|||||||
proxyArtifacts.ERC721Proxy,
|
proxyArtifacts.ERC721Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
// Depoy exchange
|
// Depoy exchange
|
||||||
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -126,6 +128,7 @@ describe('OrderMatcher', () => {
|
|||||||
artifacts.OrderMatcher,
|
artifacts.OrderMatcher,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
// Set default addresses
|
// Set default addresses
|
||||||
@@ -198,6 +201,7 @@ describe('OrderMatcher', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.NULL_BYTES,
|
constants.NULL_BYTES,
|
||||||
);
|
);
|
||||||
return expectContractCreationFailedAsync(
|
return expectContractCreationFailedAsync(
|
||||||
@@ -205,6 +209,7 @@ describe('OrderMatcher', () => {
|
|||||||
artifacts.OrderMatcher,
|
artifacts.OrderMatcher,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
) as any) as sendTransactionResult,
|
) as any) as sendTransactionResult,
|
||||||
RevertReason.UnregisteredAssetProxy,
|
RevertReason.UnregisteredAssetProxy,
|
||||||
@@ -727,6 +732,7 @@ describe('OrderMatcher', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -772,6 +778,7 @@ describe('OrderMatcher', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -789,6 +796,7 @@ describe('OrderMatcher', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
|
@@ -1,4 +1,68 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1568744790,
|
||||||
|
"version": "3.1.14",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1567521715,
|
||||||
|
"version": "3.1.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1566446343,
|
||||||
|
"version": "3.1.12",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1565296576,
|
||||||
|
"version": "3.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "3.1.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1564607468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563957393,
|
||||||
|
"version": "3.1.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": 1563193019,
|
||||||
|
"version": "3.1.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563047529,
|
"timestamp": 1563047529,
|
||||||
"version": "3.1.7",
|
"version": "3.1.7",
|
||||||
|
@@ -5,6 +5,34 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v3.1.14 - _September 17, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.1.13 - _September 3, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.1.12 - _August 22, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.1.11 - _August 8, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.1.10 - _July 31, 2019_
|
||||||
|
|
||||||
|
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||||
|
|
||||||
|
## v3.1.9 - _July 24, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
|
## v3.1.8 - _July 15, 2019_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v3.1.7 - _July 13, 2019_
|
## v3.1.7 - _July 13, 2019_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## MultiSignature Contracts
|
## MultiSignature Contracts
|
||||||
|
|
||||||
This package contains various types of multisignature wallet contracts, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that is responsible for upgrading the 0x protocol smart contracts. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
This package contains various types of multisignature wallet contracts, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that is responsible for upgrading the 0x protocol smart contracts. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-multisig",
|
"name": "@0x/contracts-multisig",
|
||||||
"version": "3.1.7",
|
"version": "3.1.14",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"compile": "sol-compiler",
|
"compile": "sol-compiler",
|
||||||
"watch": "sol-compiler -w",
|
"watch": "sol-compiler -w",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../packages/abi-gen-templates/contract.handlebars --partials '../../packages/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
@@ -47,20 +47,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^2.1.1",
|
"@0x/abi-gen": "^4.2.1",
|
||||||
"@0x/contracts-gen": "^1.0.10",
|
"@0x/contracts-gen": "^1.0.15",
|
||||||
"@0x/contracts-test-utils": "^3.1.9",
|
"@0x/contracts-test-utils": "^3.1.16",
|
||||||
"@0x/dev-utils": "^2.2.4",
|
"@0x/dev-utils": "^2.3.3",
|
||||||
"@0x/sol-compiler": "^3.1.9",
|
"@0x/sol-compiler": "^3.1.15",
|
||||||
"@0x/tslint-config": "^3.0.1",
|
"@0x/tslint-config": "^3.0.1",
|
||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^3.0.0",
|
"chai-bignumber": "^3.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^6.2.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"solhint": "^1.4.1",
|
"solhint": "^1.4.1",
|
||||||
@@ -68,15 +69,15 @@
|
|||||||
"typescript": "3.0.1"
|
"typescript": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.1",
|
"@0x/base-contract": "^5.4.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.2.1",
|
"@0x/contracts-asset-proxy": "^2.2.8",
|
||||||
"@0x/contracts-erc20": "^2.2.7",
|
"@0x/contracts-erc20": "^2.2.14",
|
||||||
"@0x/contracts-utils": "2.0.1",
|
"@0x/contracts-utils": "2.0.1",
|
||||||
"@0x/types": "^2.4.0",
|
"@0x/types": "^2.4.3",
|
||||||
"@0x/typescript-typings": "^4.2.3",
|
"@0x/typescript-typings": "^4.3.0",
|
||||||
"@0x/utils": "^4.4.0",
|
"@0x/utils": "^4.5.2",
|
||||||
"@0x/web3-wrapper": "^6.0.7",
|
"@0x/web3-wrapper": "^6.0.13",
|
||||||
"ethereum-types": "^2.1.3",
|
"ethereum-types": "^2.1.6",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
@@ -61,17 +61,20 @@ describe('AssetProxyOwner', () => {
|
|||||||
proxyArtifacts.MixinAuthorizable,
|
proxyArtifacts.MixinAuthorizable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync(
|
erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.MixinAuthorizable,
|
proxyArtifacts.MixinAuthorizable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const defaultAssetProxyContractAddresses: string[] = [];
|
const defaultAssetProxyContractAddresses: string[] = [];
|
||||||
testAssetProxyOwner = await TestAssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
testAssetProxyOwner = await TestAssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestAssetProxyOwner,
|
artifacts.TestAssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
defaultAssetProxyContractAddresses,
|
defaultAssetProxyContractAddresses,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
@@ -105,6 +108,7 @@ describe('AssetProxyOwner', () => {
|
|||||||
artifacts.AssetProxyOwner,
|
artifacts.AssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
assetProxyContractAddresses,
|
assetProxyContractAddresses,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
@@ -122,6 +126,7 @@ describe('AssetProxyOwner', () => {
|
|||||||
artifacts.AssetProxyOwner,
|
artifacts.AssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
assetProxyContractAddresses,
|
assetProxyContractAddresses,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
|
@@ -66,6 +66,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -81,6 +82,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -135,6 +137,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -198,6 +201,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.TestRejectEther,
|
artifacts.TestRejectEther,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const data = constants.NULL_BYTES;
|
const data = constants.NULL_BYTES;
|
||||||
const value = new BigNumber(10);
|
const value = new BigNumber(10);
|
||||||
@@ -234,6 +238,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -308,6 +313,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
SECONDS_TIME_LOCKED,
|
SECONDS_TIME_LOCKED,
|
||||||
|
@@ -4,14 +4,17 @@ import { BigNumber } from '@0x/utils';
|
|||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||||
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||||
|
|
||||||
import { AssetProxyOwnerContract } from '../../generated-wrappers/asset_proxy_owner';
|
import { AssetProxyOwnerContract, TestAssetProxyOwnerContract } from '../../src';
|
||||||
import { artifacts } from '../../src/artifacts';
|
import { artifacts } from '../../src/artifacts';
|
||||||
|
|
||||||
export class AssetProxyOwnerWrapper {
|
export class AssetProxyOwnerWrapper {
|
||||||
private readonly _assetProxyOwner: AssetProxyOwnerContract;
|
private readonly _assetProxyOwner: AssetProxyOwnerContract | TestAssetProxyOwnerContract;
|
||||||
private readonly _web3Wrapper: Web3Wrapper;
|
private readonly _web3Wrapper: Web3Wrapper;
|
||||||
private readonly _logDecoder: LogDecoder;
|
private readonly _logDecoder: LogDecoder;
|
||||||
constructor(assetproxyOwnerContract: AssetProxyOwnerContract, provider: Web3ProviderEngine) {
|
constructor(
|
||||||
|
assetproxyOwnerContract: AssetProxyOwnerContract | TestAssetProxyOwnerContract,
|
||||||
|
provider: Web3ProviderEngine,
|
||||||
|
) {
|
||||||
this._assetProxyOwner = assetproxyOwnerContract;
|
this._assetProxyOwner = assetproxyOwnerContract;
|
||||||
this._web3Wrapper = new Web3Wrapper(provider);
|
this._web3Wrapper = new Web3Wrapper(provider);
|
||||||
this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...proxyArtifacts });
|
this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...proxyArtifacts });
|
||||||
@@ -57,7 +60,7 @@ export class AssetProxyOwnerWrapper {
|
|||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
// tslint:disable-next-line:no-unnecessary-type-assertion
|
// tslint:disable-next-line:no-unnecessary-type-assertion
|
||||||
const txHash = await (this
|
const txHash = await (this
|
||||||
._assetProxyOwner as AssetProxyOwnerContract).executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync(
|
._assetProxyOwner as TestAssetProxyOwnerContract).executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||||
txId,
|
txId,
|
||||||
{
|
{
|
||||||
from,
|
from,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user