{
  "address": "4X79YRjz9KNMhdjdxXg2ZNTS3YnMGYdwJkBHnezMJwr3",
  "metadata": {
    "name": "access_control",
    "version": "0.2.0",
    "spec": "0.1.0",
    "description": "Access Control for Solana Programs",
    "repository": "https://github.com/upsideos/upsideos-solana-rwa"
  },
  "instructions": [
    {
      "name": "burn_securities",
      "discriminator": [
        79,
        165,
        145,
        57,
        203,
        228,
        175,
        0
      ],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              },
              {
                "kind": "account",
                "path": "authority"
              }
            ]
          }
        },
        {
          "name": "access_control",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ]
          }
        },
        {
          "name": "security_mint",
          "writable": true
        },
        {
          "name": "target_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "target_authority"
              },
              {
                "kind": "account",
                "path": "token_program"
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "target_authority"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "force_transfer_between",
      "discriminator": [
        186,
        115,
        85,
        7,
        217,
        111,
        254,
        108
      ],
      "accounts": [
        {
          "name": "source_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "source_authority"
              },
              {
                "kind": "account",
                "path": "token_program"
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "security_mint",
          "writable": true
        },
        {
          "name": "destination_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "destination_authority"
              },
              {
                "kind": "account",
                "path": "token_program"
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              },
              {
                "kind": "account",
                "path": "authority"
              }
            ]
          }
        },
        {
          "name": "access_control_account",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ]
          }
        },
        {
          "name": "source_authority"
        },
        {
          "name": "destination_authority"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "freeze_wallet",
      "discriminator": [
        93,
        202,
        159,
        167,
        22,
        246,
        255,
        211
      ],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              },
              {
                "kind": "account",
                "path": "authority"
              }
            ]
          }
        },
        {
          "name": "access_control",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ]
          }
        },
        {
          "name": "security_mint",
          "writable": true
        },
        {
          "name": "target_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "target_authority"
              },
              {
                "kind": "account",
                "path": "token_program"
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "target_authority"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        }
      ],
      "args": []
    },
    {
      "name": "grant_role",
      "discriminator": [
        218,
        234,
        128,
        15,
        82,
        33,
        236,
        253
      ],
      "accounts": [
        {
          "name": "wallet_role",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_token"
              },
              {
                "kind": "account",
                "path": "user_wallet"
              }
            ]
          }
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_token"
              },
              {
                "kind": "account",
                "path": "authority"
              }
            ]
          }
        },
        {
          "name": "access_control",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_token"
              }
            ]
          }
        },
        {
          "name": "security_token"
        },
        {
          "name": "user_wallet"
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "role",
          "type": "u8"
        }
      ]
    },
    {
      "name": "initialize_access_control",
      "discriminator": [
        244,
        90,
        245,
        242,
        199,
        224,
        247,
        140
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "authority"
        },
        {
          "name": "mint",
          "writable": true,
          "signer": true
        },
        {
          "name": "access_control",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "wallet_role",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              },
              {
                "kind": "account",
                "path": "payer"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        }
      ],
      "args": [
        {
          "name": "args",
          "type": {
            "defined": {
              "name": "InitializeAccessControlArgs"
            }
          }
        }
      ]
    },
    {
      "name": "mint_securities",
      "discriminator": [
        90,
        195,
        58,
        36,
        142,
        195,
        14,
        225
      ],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              },
              {
                "kind": "account",
                "path": "authority"
              }
            ]
          }
        },
        {
          "name": "access_control",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ]
          }
        },
        {
          "name": "security_mint",
          "writable": true
        },
        {
          "name": "destination_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "destination_authority"
              },
              {
                "kind": "account",
                "path": "token_program"
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "destination_authority"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "security_associated_account",
          "docs": [
            "This account must be initialized before minting (holder, holder_group, and SAA must exist)",
            "Optional: Not required when minting to lockup_escrow_account, mandatory otherwise"
          ],
          "optional": true
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "revoke_role",
      "discriminator": [
        179,
        232,
        2,
        180,
        48,
        227,
        82,
        7
      ],
      "accounts": [
        {
          "name": "wallet_role",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_token"
              },
              {
                "kind": "account",
                "path": "user_wallet"
              }
            ]
          }
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_token"
              },
              {
                "kind": "account",
                "path": "payer"
              }
            ]
          }
        },
        {
          "name": "access_control",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_token"
              }
            ]
          }
        },
        {
          "name": "security_token"
        },
        {
          "name": "user_wallet"
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "role",
          "type": "u8"
        }
      ]
    },
    {
      "name": "set_lockup_escrow_account",
      "discriminator": [
        134,
        172,
        249,
        223,
        25,
        118,
        55,
        93
      ],
      "accounts": [
        {
          "name": "access_control_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "mint"
        },
        {
          "name": "authority_wallet_role"
        },
        {
          "name": "escrow_account"
        },
        {
          "name": "tokenlock_account"
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        }
      ],
      "args": []
    },
    {
      "name": "set_max_total_supply",
      "discriminator": [
        249,
        164,
        34,
        254,
        160,
        89,
        214,
        12
      ],
      "accounts": [
        {
          "name": "access_control_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "mint"
        },
        {
          "name": "authority_wallet_role"
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        }
      ],
      "args": [
        {
          "name": "max_total_supply",
          "type": "u64"
        }
      ]
    },
    {
      "name": "thaw_wallet",
      "discriminator": [
        79,
        251,
        128,
        221,
        55,
        172,
        181,
        221
      ],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "authority_wallet_role",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  97,
                  108,
                  108,
                  101,
                  116,
                  95,
                  114,
                  111,
                  108,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              },
              {
                "kind": "account",
                "path": "authority"
              }
            ]
          }
        },
        {
          "name": "access_control",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  99
                ]
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ]
          }
        },
        {
          "name": "security_mint",
          "writable": true
        },
        {
          "name": "target_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "target_authority"
              },
              {
                "kind": "account",
                "path": "token_program"
              },
              {
                "kind": "account",
                "path": "security_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "target_authority"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        }
      ],
      "args": []
    }
  ],
  "accounts": [
    {
      "name": "AccessControl",
      "discriminator": [
        147,
        81,
        178,
        92,
        223,
        66,
        181,
        132
      ]
    },
    {
      "name": "WalletRole",
      "discriminator": [
        219,
        71,
        35,
        217,
        102,
        248,
        173,
        9
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "Unauthorized",
      "msg": "Unauthorized"
    },
    {
      "code": 6001,
      "name": "InvalidRole",
      "msg": "Invalid role"
    },
    {
      "code": 6002,
      "name": "MintExceedsMaxTotalSupply",
      "msg": "Cannot mint more than max total supply"
    },
    {
      "code": 6003,
      "name": "IncorrectTokenlockAccount",
      "msg": "Wrong tokenlock account"
    },
    {
      "code": 6004,
      "name": "MismatchedEscrowAccount",
      "msg": "Mismatched escrow account"
    },
    {
      "code": 6005,
      "name": "CantBurnSecuritiesWithinLockup",
      "msg": "Cannot burn securities within lockup; cancel the lockup first"
    },
    {
      "code": 6006,
      "name": "CantForceTransferBetweenLockup",
      "msg": "Cannot force transfer between lockup accounts"
    },
    {
      "code": 6007,
      "name": "NewMaxTotalSupplyMustExceedCurrentTotalSupply",
      "msg": "New max total supply must exceed current total supply"
    },
    {
      "code": 6008,
      "name": "CannotFreezeLockupEscrowAccount",
      "msg": "Cannot freeze lockup escrow account"
    },
    {
      "code": 6009,
      "name": "ValueUnchanged",
      "msg": "The provided value is already set. No changes were made"
    },
    {
      "code": 6010,
      "name": "InvalidSecurityAssociatedAccount",
      "msg": "Invalid security associated account"
    },
    {
      "code": 6011,
      "name": "SecurityAssociatedAccountNotInitialized",
      "msg": "Security associated account not initialized"
    },
    {
      "code": 6012,
      "name": "TransferHookNotConfigured",
      "msg": "Transfer hook not configured on mint"
    },
    {
      "code": 6013,
      "name": "SecurityAssociatedAccountRequired",
      "msg": "Security associated account is required"
    },
    {
      "code": 6014,
      "name": "AlreadyHasRole",
      "msg": "Wallet already has this role"
    },
    {
      "code": 6015,
      "name": "CannotRevokeRole",
      "msg": "Cannot revoke role that wallet does not have"
    },
    {
      "code": 6016,
      "name": "InvalidAccessControl",
      "msg": "Invalid access control"
    },
    {
      "code": 6017,
      "name": "InvalidWalletRoleAccountOwner",
      "msg": "Invalid wallet role account owner"
    }
  ],
  "types": [
    {
      "name": "AccessControl",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "authority",
            "type": "pubkey"
          },
          {
            "name": "max_total_supply",
            "type": "u64"
          },
          {
            "name": "lockup_escrow_account",
            "type": {
              "option": "pubkey"
            }
          }
        ]
      }
    },
    {
      "name": "InitializeAccessControlArgs",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "decimals",
            "type": "u8"
          },
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "symbol",
            "type": "string"
          },
          {
            "name": "uri",
            "type": "string"
          },
          {
            "name": "hook_program_id",
            "type": "pubkey"
          },
          {
            "name": "max_total_supply",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "WalletRole",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "access_control",
            "type": "pubkey"
          },
          {
            "name": "role",
            "type": "u8"
          }
        ]
      }
    }
  ]
}