@bloxchain/contracts 1.0.0-alpha.2 → 1.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/abi/AccountBlox.abi.json +63 -94
  2. package/abi/BareBlox.abi.json +75 -0
  3. package/abi/BaseStateMachine.abi.json +75 -0
  4. package/abi/EngineBlox.abi.json +0 -5
  5. package/abi/GuardController.abi.json +75 -19
  6. package/abi/RoleBlox.abi.json +65 -51
  7. package/abi/RuntimeRBAC.abi.json +75 -44
  8. package/abi/SecureBlox.abi.json +85 -27
  9. package/abi/SecureOwnable.abi.json +85 -27
  10. package/abi/SimpleRWA20.abi.json +85 -16
  11. package/abi/SimpleVault.abi.json +85 -16
  12. package/core/access/RuntimeRBAC.sol +231 -270
  13. package/core/access/interface/IRuntimeRBAC.sol +0 -21
  14. package/core/base/BaseStateMachine.sol +893 -881
  15. package/core/base/interface/IBaseStateMachine.sol +7 -0
  16. package/core/execution/GuardController.sol +0 -14
  17. package/core/execution/interface/IGuardController.sol +2 -2
  18. package/core/lib/EngineBlox.sol +30 -8
  19. package/core/research/BloxchainWallet.sol +16 -30
  20. package/core/research/erc1155-blox/ERC1155Blox.sol +176 -0
  21. package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +203 -0
  22. package/core/research/erc20-blox/ERC20Blox.sol +5 -8
  23. package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +185 -185
  24. package/core/research/erc721-blox/ERC721Blox.sol +138 -0
  25. package/core/research/erc721-blox/lib/definitions/ERC721BloxDefinitions.sol +172 -0
  26. package/core/security/SecureOwnable.sol +16 -11
  27. package/core/security/interface/ISecureOwnable.sol +105 -104
  28. package/core/security/lib/definitions/SecureOwnableDefinitions.sol +786 -786
  29. package/package.json +49 -49
  30. package/utils/SharedValidation.sol +487 -487
@@ -53,17 +53,6 @@
53
53
  "name": "InternalFunctionNotAccessible",
54
54
  "type": "error"
55
55
  },
56
- {
57
- "inputs": [
58
- {
59
- "internalType": "address",
60
- "name": "provided",
61
- "type": "address"
62
- }
63
- ],
64
- "name": "InvalidAddress",
65
- "type": "error"
66
- },
67
56
  {
68
57
  "inputs": [],
69
58
  "name": "InvalidInitialization",
@@ -112,22 +101,6 @@
112
101
  "name": "NotInitializing",
113
102
  "type": "error"
114
103
  },
115
- {
116
- "inputs": [
117
- {
118
- "internalType": "address",
119
- "name": "newAddress",
120
- "type": "address"
121
- },
122
- {
123
- "internalType": "address",
124
- "name": "currentAddress",
125
- "type": "address"
126
- }
127
- ],
128
- "name": "NotNewAddress",
129
- "type": "error"
130
- },
131
104
  {
132
105
  "inputs": [],
133
106
  "name": "NotSupported",
@@ -269,25 +242,6 @@
269
242
  "name": "ComponentEvent",
270
243
  "type": "event"
271
244
  },
272
- {
273
- "anonymous": false,
274
- "inputs": [
275
- {
276
- "indexed": true,
277
- "internalType": "address",
278
- "name": "from",
279
- "type": "address"
280
- },
281
- {
282
- "indexed": false,
283
- "internalType": "uint256",
284
- "name": "amount",
285
- "type": "uint256"
286
- }
287
- ],
288
- "name": "EthReceived",
289
- "type": "event"
290
- },
291
245
  {
292
246
  "anonymous": false,
293
247
  "inputs": [
@@ -1187,6 +1141,11 @@
1187
1141
  "internalType": "address",
1188
1142
  "name": "newBroadcaster",
1189
1143
  "type": "address"
1144
+ },
1145
+ {
1146
+ "internalType": "uint256",
1147
+ "name": "location",
1148
+ "type": "uint256"
1190
1149
  }
1191
1150
  ],
1192
1151
  "name": "executeBroadcasterUpdate",
@@ -1971,14 +1930,8 @@
1971
1930
  "type": "function"
1972
1931
  },
1973
1932
  {
1974
- "inputs": [
1975
- {
1976
- "internalType": "bytes4",
1977
- "name": "functionSelector",
1978
- "type": "bytes4"
1979
- }
1980
- ],
1981
- "name": "getAllowedTargets",
1933
+ "inputs": [],
1934
+ "name": "getBroadcasters",
1982
1935
  "outputs": [
1983
1936
  {
1984
1937
  "internalType": "address[]",
@@ -1990,13 +1943,56 @@
1990
1943
  "type": "function"
1991
1944
  },
1992
1945
  {
1993
- "inputs": [],
1994
- "name": "getBroadcasters",
1946
+ "inputs": [
1947
+ {
1948
+ "internalType": "bytes4",
1949
+ "name": "functionSelector",
1950
+ "type": "bytes4"
1951
+ }
1952
+ ],
1953
+ "name": "getFunctionSchema",
1995
1954
  "outputs": [
1996
1955
  {
1997
- "internalType": "address[]",
1956
+ "components": [
1957
+ {
1958
+ "internalType": "string",
1959
+ "name": "functionSignature",
1960
+ "type": "string"
1961
+ },
1962
+ {
1963
+ "internalType": "bytes4",
1964
+ "name": "functionSelector",
1965
+ "type": "bytes4"
1966
+ },
1967
+ {
1968
+ "internalType": "bytes32",
1969
+ "name": "operationType",
1970
+ "type": "bytes32"
1971
+ },
1972
+ {
1973
+ "internalType": "string",
1974
+ "name": "operationName",
1975
+ "type": "string"
1976
+ },
1977
+ {
1978
+ "internalType": "uint16",
1979
+ "name": "supportedActionsBitmap",
1980
+ "type": "uint16"
1981
+ },
1982
+ {
1983
+ "internalType": "bool",
1984
+ "name": "isProtected",
1985
+ "type": "bool"
1986
+ },
1987
+ {
1988
+ "internalType": "bytes4[]",
1989
+ "name": "handlerForSelectors",
1990
+ "type": "bytes4[]"
1991
+ }
1992
+ ],
1993
+ "internalType": "struct EngineBlox.FunctionSchema",
1998
1994
  "name": "",
1999
- "type": "address[]"
1995
+ "type": "tuple"
2000
1996
  }
2001
1997
  ],
2002
1998
  "stateMutability": "view",
@@ -2010,37 +2006,12 @@
2010
2006
  "type": "bytes4"
2011
2007
  }
2012
2008
  ],
2013
- "name": "getFunctionSchema",
2009
+ "name": "getFunctionWhitelistTargets",
2014
2010
  "outputs": [
2015
2011
  {
2016
- "internalType": "string",
2017
- "name": "functionSignature",
2018
- "type": "string"
2019
- },
2020
- {
2021
- "internalType": "bytes4",
2022
- "name": "functionSelectorReturn",
2023
- "type": "bytes4"
2024
- },
2025
- {
2026
- "internalType": "bytes32",
2027
- "name": "operationType",
2028
- "type": "bytes32"
2029
- },
2030
- {
2031
- "internalType": "string",
2032
- "name": "operationName",
2033
- "type": "string"
2034
- },
2035
- {
2036
- "internalType": "enum EngineBlox.TxAction[]",
2037
- "name": "supportedActions",
2038
- "type": "uint8[]"
2039
- },
2040
- {
2041
- "internalType": "bool",
2042
- "name": "isProtected",
2043
- "type": "bool"
2012
+ "internalType": "address[]",
2013
+ "name": "",
2014
+ "type": "address[]"
2044
2015
  }
2045
2016
  ],
2046
2017
  "stateMutability": "view",
@@ -5064,6 +5035,11 @@
5064
5035
  "internalType": "address",
5065
5036
  "name": "newBroadcaster",
5066
5037
  "type": "address"
5038
+ },
5039
+ {
5040
+ "internalType": "uint256",
5041
+ "name": "location",
5042
+ "type": "uint256"
5067
5043
  }
5068
5044
  ],
5069
5045
  "name": "updateBroadcasterRequest",
@@ -5788,12 +5764,5 @@
5788
5764
  ],
5789
5765
  "stateMutability": "view",
5790
5766
  "type": "function"
5791
- },
5792
- {
5793
- "inputs": [],
5794
- "name": "deposit",
5795
- "outputs": [],
5796
- "stateMutability": "payable",
5797
- "type": "function"
5798
5767
  }
5799
5768
  ]
@@ -746,6 +746,81 @@
746
746
  "stateMutability": "view",
747
747
  "type": "function"
748
748
  },
749
+ {
750
+ "inputs": [
751
+ {
752
+ "internalType": "bytes4",
753
+ "name": "functionSelector",
754
+ "type": "bytes4"
755
+ }
756
+ ],
757
+ "name": "getFunctionSchema",
758
+ "outputs": [
759
+ {
760
+ "components": [
761
+ {
762
+ "internalType": "string",
763
+ "name": "functionSignature",
764
+ "type": "string"
765
+ },
766
+ {
767
+ "internalType": "bytes4",
768
+ "name": "functionSelector",
769
+ "type": "bytes4"
770
+ },
771
+ {
772
+ "internalType": "bytes32",
773
+ "name": "operationType",
774
+ "type": "bytes32"
775
+ },
776
+ {
777
+ "internalType": "string",
778
+ "name": "operationName",
779
+ "type": "string"
780
+ },
781
+ {
782
+ "internalType": "uint16",
783
+ "name": "supportedActionsBitmap",
784
+ "type": "uint16"
785
+ },
786
+ {
787
+ "internalType": "bool",
788
+ "name": "isProtected",
789
+ "type": "bool"
790
+ },
791
+ {
792
+ "internalType": "bytes4[]",
793
+ "name": "handlerForSelectors",
794
+ "type": "bytes4[]"
795
+ }
796
+ ],
797
+ "internalType": "struct EngineBlox.FunctionSchema",
798
+ "name": "",
799
+ "type": "tuple"
800
+ }
801
+ ],
802
+ "stateMutability": "view",
803
+ "type": "function"
804
+ },
805
+ {
806
+ "inputs": [
807
+ {
808
+ "internalType": "bytes4",
809
+ "name": "functionSelector",
810
+ "type": "bytes4"
811
+ }
812
+ ],
813
+ "name": "getFunctionWhitelistTargets",
814
+ "outputs": [
815
+ {
816
+ "internalType": "address[]",
817
+ "name": "",
818
+ "type": "address[]"
819
+ }
820
+ ],
821
+ "stateMutability": "view",
822
+ "type": "function"
823
+ },
749
824
  {
750
825
  "inputs": [],
751
826
  "name": "getPendingTransactions",
@@ -1128,6 +1128,62 @@
1128
1128
  "stateMutability": "view",
1129
1129
  "type": "function"
1130
1130
  },
1131
+ {
1132
+ "inputs": [
1133
+ {
1134
+ "internalType": "bytes4",
1135
+ "name": "functionSelector",
1136
+ "type": "bytes4"
1137
+ }
1138
+ ],
1139
+ "name": "getFunctionSchema",
1140
+ "outputs": [
1141
+ {
1142
+ "components": [
1143
+ {
1144
+ "internalType": "string",
1145
+ "name": "functionSignature",
1146
+ "type": "string"
1147
+ },
1148
+ {
1149
+ "internalType": "bytes4",
1150
+ "name": "functionSelector",
1151
+ "type": "bytes4"
1152
+ },
1153
+ {
1154
+ "internalType": "bytes32",
1155
+ "name": "operationType",
1156
+ "type": "bytes32"
1157
+ },
1158
+ {
1159
+ "internalType": "string",
1160
+ "name": "operationName",
1161
+ "type": "string"
1162
+ },
1163
+ {
1164
+ "internalType": "uint16",
1165
+ "name": "supportedActionsBitmap",
1166
+ "type": "uint16"
1167
+ },
1168
+ {
1169
+ "internalType": "bool",
1170
+ "name": "isProtected",
1171
+ "type": "bool"
1172
+ },
1173
+ {
1174
+ "internalType": "bytes4[]",
1175
+ "name": "handlerForSelectors",
1176
+ "type": "bytes4[]"
1177
+ }
1178
+ ],
1179
+ "internalType": "struct EngineBlox.FunctionSchema",
1180
+ "name": "",
1181
+ "type": "tuple"
1182
+ }
1183
+ ],
1184
+ "stateMutability": "view",
1185
+ "type": "function"
1186
+ },
1131
1187
  {
1132
1188
  "inputs": [
1133
1189
  {
@@ -1247,5 +1303,24 @@
1247
1303
  ],
1248
1304
  "stateMutability": "view",
1249
1305
  "type": "function"
1306
+ },
1307
+ {
1308
+ "inputs": [
1309
+ {
1310
+ "internalType": "bytes4",
1311
+ "name": "functionSelector",
1312
+ "type": "bytes4"
1313
+ }
1314
+ ],
1315
+ "name": "getFunctionWhitelistTargets",
1316
+ "outputs": [
1317
+ {
1318
+ "internalType": "address[]",
1319
+ "name": "",
1320
+ "type": "address[]"
1321
+ }
1322
+ ],
1323
+ "stateMutability": "view",
1324
+ "type": "function"
1250
1325
  }
1251
1326
  ]
@@ -64,11 +64,6 @@
64
64
  "internalType": "bytes4",
65
65
  "name": "functionSelector",
66
66
  "type": "bytes4"
67
- },
68
- {
69
- "internalType": "string",
70
- "name": "functionSignature",
71
- "type": "string"
72
67
  }
73
68
  ],
74
69
  "name": "ContractFunctionMustBeProtected",
@@ -832,6 +832,81 @@
832
832
  "stateMutability": "view",
833
833
  "type": "function"
834
834
  },
835
+ {
836
+ "inputs": [
837
+ {
838
+ "internalType": "bytes4",
839
+ "name": "functionSelector",
840
+ "type": "bytes4"
841
+ }
842
+ ],
843
+ "name": "getFunctionSchema",
844
+ "outputs": [
845
+ {
846
+ "components": [
847
+ {
848
+ "internalType": "string",
849
+ "name": "functionSignature",
850
+ "type": "string"
851
+ },
852
+ {
853
+ "internalType": "bytes4",
854
+ "name": "functionSelector",
855
+ "type": "bytes4"
856
+ },
857
+ {
858
+ "internalType": "bytes32",
859
+ "name": "operationType",
860
+ "type": "bytes32"
861
+ },
862
+ {
863
+ "internalType": "string",
864
+ "name": "operationName",
865
+ "type": "string"
866
+ },
867
+ {
868
+ "internalType": "uint16",
869
+ "name": "supportedActionsBitmap",
870
+ "type": "uint16"
871
+ },
872
+ {
873
+ "internalType": "bool",
874
+ "name": "isProtected",
875
+ "type": "bool"
876
+ },
877
+ {
878
+ "internalType": "bytes4[]",
879
+ "name": "handlerForSelectors",
880
+ "type": "bytes4[]"
881
+ }
882
+ ],
883
+ "internalType": "struct EngineBlox.FunctionSchema",
884
+ "name": "",
885
+ "type": "tuple"
886
+ }
887
+ ],
888
+ "stateMutability": "view",
889
+ "type": "function"
890
+ },
891
+ {
892
+ "inputs": [
893
+ {
894
+ "internalType": "bytes4",
895
+ "name": "functionSelector",
896
+ "type": "bytes4"
897
+ }
898
+ ],
899
+ "name": "getFunctionWhitelistTargets",
900
+ "outputs": [
901
+ {
902
+ "internalType": "address[]",
903
+ "name": "",
904
+ "type": "address[]"
905
+ }
906
+ ],
907
+ "stateMutability": "view",
908
+ "type": "function"
909
+ },
835
910
  {
836
911
  "inputs": [],
837
912
  "name": "getPendingTransactions",
@@ -2881,24 +2956,5 @@
2881
2956
  "outputs": [],
2882
2957
  "stateMutability": "nonpayable",
2883
2958
  "type": "function"
2884
- },
2885
- {
2886
- "inputs": [
2887
- {
2888
- "internalType": "bytes4",
2889
- "name": "functionSelector",
2890
- "type": "bytes4"
2891
- }
2892
- ],
2893
- "name": "getAllowedTargets",
2894
- "outputs": [
2895
- {
2896
- "internalType": "address[]",
2897
- "name": "",
2898
- "type": "address[]"
2899
- }
2900
- ],
2901
- "stateMutability": "view",
2902
- "type": "function"
2903
2959
  }
2904
2960
  ]
@@ -42,17 +42,6 @@
42
42
  "name": "CannotModifyProtected",
43
43
  "type": "error"
44
44
  },
45
- {
46
- "inputs": [
47
- {
48
- "internalType": "address",
49
- "name": "provided",
50
- "type": "address"
51
- }
52
- ],
53
- "name": "InvalidAddress",
54
- "type": "error"
55
- },
56
45
  {
57
46
  "inputs": [],
58
47
  "name": "InvalidInitialization",
@@ -101,22 +90,6 @@
101
90
  "name": "NotInitializing",
102
91
  "type": "error"
103
92
  },
104
- {
105
- "inputs": [
106
- {
107
- "internalType": "address",
108
- "name": "newAddress",
109
- "type": "address"
110
- },
111
- {
112
- "internalType": "address",
113
- "name": "currentAddress",
114
- "type": "address"
115
- }
116
- ],
117
- "name": "NotNewAddress",
118
- "type": "error"
119
- },
120
93
  {
121
94
  "inputs": [],
122
95
  "name": "NotSupported",
@@ -352,6 +325,11 @@
352
325
  "internalType": "address",
353
326
  "name": "newBroadcaster",
354
327
  "type": "address"
328
+ },
329
+ {
330
+ "internalType": "uint256",
331
+ "name": "location",
332
+ "type": "uint256"
355
333
  }
356
334
  ],
357
335
  "name": "executeBroadcasterUpdate",
@@ -994,34 +972,65 @@
994
972
  "name": "getFunctionSchema",
995
973
  "outputs": [
996
974
  {
997
- "internalType": "string",
998
- "name": "functionSignature",
999
- "type": "string"
1000
- },
975
+ "components": [
976
+ {
977
+ "internalType": "string",
978
+ "name": "functionSignature",
979
+ "type": "string"
980
+ },
981
+ {
982
+ "internalType": "bytes4",
983
+ "name": "functionSelector",
984
+ "type": "bytes4"
985
+ },
986
+ {
987
+ "internalType": "bytes32",
988
+ "name": "operationType",
989
+ "type": "bytes32"
990
+ },
991
+ {
992
+ "internalType": "string",
993
+ "name": "operationName",
994
+ "type": "string"
995
+ },
996
+ {
997
+ "internalType": "uint16",
998
+ "name": "supportedActionsBitmap",
999
+ "type": "uint16"
1000
+ },
1001
+ {
1002
+ "internalType": "bool",
1003
+ "name": "isProtected",
1004
+ "type": "bool"
1005
+ },
1006
+ {
1007
+ "internalType": "bytes4[]",
1008
+ "name": "handlerForSelectors",
1009
+ "type": "bytes4[]"
1010
+ }
1011
+ ],
1012
+ "internalType": "struct EngineBlox.FunctionSchema",
1013
+ "name": "",
1014
+ "type": "tuple"
1015
+ }
1016
+ ],
1017
+ "stateMutability": "view",
1018
+ "type": "function"
1019
+ },
1020
+ {
1021
+ "inputs": [
1001
1022
  {
1002
1023
  "internalType": "bytes4",
1003
- "name": "functionSelectorReturn",
1024
+ "name": "functionSelector",
1004
1025
  "type": "bytes4"
1005
- },
1006
- {
1007
- "internalType": "bytes32",
1008
- "name": "operationType",
1009
- "type": "bytes32"
1010
- },
1011
- {
1012
- "internalType": "string",
1013
- "name": "operationName",
1014
- "type": "string"
1015
- },
1016
- {
1017
- "internalType": "enum EngineBlox.TxAction[]",
1018
- "name": "supportedActions",
1019
- "type": "uint8[]"
1020
- },
1026
+ }
1027
+ ],
1028
+ "name": "getFunctionWhitelistTargets",
1029
+ "outputs": [
1021
1030
  {
1022
- "internalType": "bool",
1023
- "name": "isProtected",
1024
- "type": "bool"
1031
+ "internalType": "address[]",
1032
+ "name": "",
1033
+ "type": "address[]"
1025
1034
  }
1026
1035
  ],
1027
1036
  "stateMutability": "view",
@@ -3485,6 +3494,11 @@
3485
3494
  "internalType": "address",
3486
3495
  "name": "newBroadcaster",
3487
3496
  "type": "address"
3497
+ },
3498
+ {
3499
+ "internalType": "uint256",
3500
+ "name": "location",
3501
+ "type": "uint256"
3488
3502
  }
3489
3503
  ],
3490
3504
  "name": "updateBroadcasterRequest",