{
    "Function": "execute",
    "File": "contracts/Identity.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "SignatureValidator"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "keccak256(bytes)",
        "require(bool,string)",
        "executeCall",
        "require(bool,string)",
        "abi.encode()"
    ],
    "Library Calls": [
        "recoverAddrImpl"
    ],
    "Low-Level Calls": [],
    "Code": "function execute(Transaction[] calldata txns, bytes calldata signature)\n\t\texternal\n\t{\n\t\trequire(txns.length > 0, 'MUST_PASS_TX');\n\t\t// If we use the naive abi.encode(txn) and have a field of type `bytes`,\n\t\t// there is a discrepancy between ethereumjs-abi and solidity\n\t\t// @TODO check if this is resolved\n\t\tuint currentNonce = nonce;\n\t\t// NOTE: abi.encode is safer than abi.encodePacked in terms of collision safety\n\t\tbytes32 hash = keccak256(abi.encode(address(this), block.chainid, currentNonce, txns));\n\t\t// We have to increment before execution cause it protects from reentrancies\n\t\tnonce = currentNonce + 1;\n\n\t\taddress signer = SignatureValidator.recoverAddrImpl(hash, signature, true);\n\t\trequire(privileges[signer] != bytes32(0), 'INSUFFICIENT_PRIVILEGE');\n\t\tuint len = txns.length;\n\t\tfor (uint i=0; i<len; i++) {\n\t\t\tTransaction memory txn = txns[i];\n\t\t\texecuteCall(txn.to, txn.value, txn.data);\n\t\t}\n\t\t// The actual anti-bricking mechanism - do not allow a signer to drop their own priviledges\n\t\trequire(privileges[signer] != bytes32(0), 'PRIVILEGE_NOT_DOWNGRADED');\n\t}"
}