Created
November 29, 2022 01:15
-
-
Save argctl/fe3a85a78cdf4d0f2d2611f72916daf6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.8.4; | |
| contract Auth { | |
| //mappings | |
| constructor () { | |
| } | |
| //TODO - order slices array by number lowest to highest or expect it. | |
| function layer (bool[] requires, int[] slices) { | |
| // requires in layers by slice of bools | |
| // require(bool1 || bool2 || bool3) | |
| uint sliceIndex = 0; | |
| for (uint i = 0; i < requires.length; i++) { | |
| if (slices[sliceIndex]) { | |
| require(requireCache); | |
| sliceIndex++; | |
| } | |
| requireCache = requires[i] || requireCache; | |
| } | |
| // // slice == [4] at index 0 | |
| // then we do at slice require(bool4 || bool...) | |
| //require(||) | |
| } | |
| function execute(bool[] requires, int[] slices, int[] codes) { | |
| // codes map to data or functions | |
| // code is int that maps to a string that can be fed to another function to produce a result. | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment