You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,44 +16,41 @@ It isn't that any of these features are bad, that isn't the point. It is that we
16
16
17
17
If this feature ban breaks your mind, just realize that this smart contract library is different than what you have encountered before -- it has different importances, different design principles and it has different ways of doing things. Open your mind and be willing to look at smart contracts a different way. Let the design section rewrite your brain.
18
18
19
-
###1. Inheritance is **banned**.
19
+
1.### Inheritance is **banned**.
20
20
21
21
No contract may inherit any other contract or interface. For example `MyContract is OtherContract` or `MyContract is IMyInterface` etc. is not allowed.
22
22
23
-
###2. No constructor functions
23
+
2.### No constructor functions
24
24
25
25
No contracts other than a diamond contract (proxy contract), may have a constructor function. For example: `constructor() {owner = msg.sender; }` etc.
26
26
27
-
###3. No modifiers
27
+
3.### No modifiers
28
28
29
29
No contract may use modifiers. For example: `modifier onlyOwner() { require(msg.sender == owner, "Caller is not the owner"); _; }` etc.
30
30
31
-
###4. No public or private or internal variables
31
+
4.### No public or private or internal variables
32
32
33
33
No contract or library may have variables declared private or public or internal. For example: `uint256 public counter;`. These visibility labels are not needed because the library uses ERC-8042 Diamond Storage through out.
34
34
35
-
###5. No private functions
35
+
5.### No private functions
36
36
37
37
No contract or library may have a function declared private. For example: `function approve(address _spender, uint256 _value) private { ...`. This means all functions in contracts must be delcared `internal` or `external`.
38
38
39
-
###6. No external functions in Solidity libraries
39
+
6.### No external functions in Solidity libraries
40
40
41
41
No Solidity library may have any external functions. For example: `function name() external view returns (string memory)`. All functions in Solidity libraries must be delcared `internal`.
42
42
43
-
###7. No `using for` in Solidity libraries
43
+
7.### No `using for` in Solidity libraries
44
44
45
45
No Solidity library may use the `using` directive. For example: `using LibSomething for uint`.
46
46
47
-
###8. No `selfdestruct`.
47
+
8.### No `selfdestruct`.
48
48
49
49
No contract or libary may use `selfdestruct`.
50
50
51
51
Other Solidity features will likely be added to this ban list.
52
52
53
-
Note that the feature ban applies to the smart contracts and libraries within Compose. It does not apply to the users that use the library. Users can do what they want to do and it is our job to help them.
54
-
55
-
56
-
53
+
Note that the feature ban applies to the smart contracts and libraries within Compose. It does not apply to the users that use Compose. Users can do what they want to do and it is our job to help them.
0 commit comments