Skip to content

Instantly share code, notes, and snippets.

@argctl
Created November 29, 2022 01:15
Show Gist options
  • Select an option

  • Save argctl/fe3a85a78cdf4d0f2d2611f72916daf6 to your computer and use it in GitHub Desktop.

Select an option

Save argctl/fe3a85a78cdf4d0f2d2611f72916daf6 to your computer and use it in GitHub Desktop.
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