{
  "address": "Af4LiYSyEbHj8XBdbjRzFzpx31WmqS3LNXHyHbc8hxzg",
  "metadata": {
    "name": "rwa_automation",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "RWA automation program (payout scheduling registry)"
  },
  "instructions": [
    {
      "name": "init_config",
      "docs": [
        "Bind this program to its governing authority. Callable ONCE, and only by the program's",
        "current upgrade authority.",
        "",
        "Gating on the upgrade authority is what makes the bootstrap safe: at deploy time that is",
        "the deploy wallet, and after the Squads handoff it is the multisig vault. The only party",
        "who can claim a program's Config is therefore the same party who can already replace its",
        "bytecode. A permissionless `init_config` would simply move the first-caller-wins hole",
        "from the per-asset PDAs up to the global one."
      ],
      "discriminator": [
        23,
        235,
        115,
        232,
        168,
        96,
        1,
        231
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "upgrade_authority",
          "docs": [
            "Must be this program's current upgrade authority."
          ],
          "signer": true
        },
        {
          "name": "program_data"
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "authority",
          "type": "pubkey"
        },
        {
          "name": "operator",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "register_token",
      "docs": [
        "Register a token for scheduled payouts. Admin (multisig) only.",
        "Mirrors AutomationRegistry.registerToken(token, batchSize)."
      ],
      "discriminator": [
        32,
        146,
        36,
        240,
        80,
        183,
        36,
        84
      ],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "admin",
          "signer": true
        },
        {
          "name": "mint"
        },
        {
          "name": "schedule",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115,
                  99,
                  104,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "batch_size",
          "type": "u32"
        },
        {
          "name": "keeper",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "set_active",
      "docs": [
        "Enable/disable scheduling. Admin only."
      ],
      "discriminator": [
        29,
        16,
        225,
        132,
        38,
        216,
        206,
        33
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true
        },
        {
          "name": "schedule",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115,
                  99,
                  104,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "schedule.mint",
                "account": "Schedule"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "active",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_config_authority",
      "docs": [
        "Rotate the governing authority (migrating to a new Squads multisig) and/or the operator",
        "hot key. Current authority only.",
        "",
        "Every per-asset account created BEFORE a rotation keeps the old admin recorded in its own",
        "state — this only changes who may create new ones. Rotating existing assets is a separate",
        "concern (see M-1 in SECURITY-AUDIT.md)."
      ],
      "discriminator": [
        16,
        200,
        212,
        18,
        95,
        43,
        107,
        89
      ],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "authority",
          "type": "pubkey"
        },
        {
          "name": "operator",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "set_keeper",
      "docs": [
        "Replace the keeper allowed to trigger this schedule. Admin only (M-1)."
      ],
      "discriminator": [
        102,
        94,
        23,
        78,
        157,
        222,
        243,
        214
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true
        },
        {
          "name": "schedule",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115,
                  99,
                  104,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "schedule.mint",
                "account": "Schedule"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "keeper",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "sync_admin",
      "docs": [
        "Re-point this account's `admin` at the CURRENT `config.authority`.",
        "",
        "SECURITY-AUDIT M-1: every per-asset admin was written once at creation and never again,",
        "so rotating the Squad left every existing asset pointing at the old multisig — and the",
        "more assets exist, the worse that gets. `set_config_authority` moves the program-level",
        "authority; this carries the change down to accounts that already exist.",
        "",
        "The new value is READ FROM CONFIG, never supplied by the caller, so this can only ever",
        "converge an account onto the current authority. It cannot redirect one anywhere else,",
        "which is why gating it on the operator is enough — there is no value here to abuse."
      ],
      "discriminator": [
        39,
        26,
        200,
        133,
        62,
        114,
        42,
        235
      ],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "signer",
          "signer": true
        },
        {
          "name": "schedule",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115,
                  99,
                  104,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "schedule.mint",
                "account": "Schedule"
              }
            ]
          }
        }
      ],
      "args": []
    }
  ],
  "accounts": [
    {
      "name": "Config",
      "discriminator": [
        155,
        12,
        170,
        224,
        30,
        250,
        204,
        130
      ]
    },
    {
      "name": "Schedule",
      "discriminator": [
        217,
        243,
        116,
        56,
        73,
        82,
        207,
        51
      ]
    }
  ],
  "events": [
    {
      "name": "AdminSynced",
      "discriminator": [
        31,
        149,
        231,
        47,
        182,
        14,
        227,
        231
      ]
    },
    {
      "name": "ConfigSet",
      "discriminator": [
        15,
        104,
        59,
        16,
        236,
        241,
        8,
        6
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "Unauthorized",
      "msg": "caller is not authorized for this action"
    }
  ],
  "types": [
    {
      "name": "AdminSynced",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "previous",
            "type": "pubkey"
          },
          {
            "name": "current",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Config",
      "docs": [
        "Program-level authority. One per program, seeds [\"config\"].",
        "",
        "Exists because every per-asset `init` instruction used to accept an unconstrained `Signer`",
        "as \"admin\" and write it straight into the new account, making whoever called first the",
        "owner of a PDA our own flow would later fund. See C-1..C-5 in SECURITY-AUDIT.md."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "authority",
            "docs": [
              "Governing authority — the Squads vault PDA. Written into every per-asset account's",
              "admin/owner field, so a caller can never nominate itself."
            ],
            "type": "pubkey"
          },
          {
            "name": "operator",
            "docs": [
              "Operator hot key. May CREATE per-asset accounts and pay their rent, but never chooses",
              "who controls them."
            ],
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "ConfigSet",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "authority",
            "type": "pubkey"
          },
          {
            "name": "operator",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Schedule",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "admin",
            "type": "pubkey"
          },
          {
            "name": "keeper",
            "type": "pubkey"
          },
          {
            "name": "batch_size",
            "type": "u32"
          },
          {
            "name": "active",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    }
  ]
}