# Head Ambassador Removal Tutorial on how to remove a current Head Ambassador. They need to appear in [this list](https://collectives.subsquare.io/ambassador/members) for it to work. Note that they can immediately re-apply after being removed. ## 1. Prepare the Preimage on the Collectives Chain - Go to PolkadotJS and decode [this](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-collectives-polkadot.luckyfriday.io#/extrinsics/decode/0x460300f65f3cade8f68e8f34c6266b0d37e58a754059ca96816e964f98e17c795050730300) extrinsic. - Click on `Submission` to modify the parameters: - ![Screenshot 2024-06-11 at 10.17.50](https://hackmd.io/_uploads/rytE_tBSR.png) - Replace the addess `who` with the HA that you want to remove. - Copy the `encoded call data` (not the hash!) ![Screenshot 2024-07-16 at 20.06.02](https://hackmd.io/_uploads/BkS9LV4OC.png) - This will look different for everyone. ## 2. Prepare the Preimage on the Relay chain - Go to the Relay chain with [this](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frockx-dot.w3node.com%2Fpolka-public-dot%2Fws#/extrinsics/decode/0x630004000100a50f04082f000006030300286bee42420f00b47265706c616365206d6520776974682074686520636f6c6c6563746976657320707265696d6167652064617461) link. - Click on `Submission` again and paste the preimage from above in the `call: XcmDoubleEncoded` field in the bottom: ![Screenshot 2024-06-11 at 10.24.33](https://hackmd.io/_uploads/ByiattrBC.png) - Once you are done, again copy the `encoded call data` (not the hash!) ## 3. Place the preimage on the Relay Chain - Go to `Developer->Extrinsic` - Create a `Preimage::notePreimage(bytes)` extrinsic. - The bytes are pasted from the relay preimage that we created above. - ![Screenshot 2024-06-11 at 10.39.09](https://hackmd.io/_uploads/rkOV6KrrA.png) - Click on `Submit Transaction`. Note that it will reserve a deposit for the preimage; having about 50 DOT on the address is a good idea. - Go to `Governance->Preimages` and find your preimage there: - It should look something like this: ![Screenshot 2024-07-16 at 19.09.48](https://hackmd.io/_uploads/H1uDF7NuC.png) - Copy the `Hash` and `Length` for later. - If you want to double-check these values, you can go to `Developer->Storage` and query `Preimage::preimageFor` with these details. It should print the Relay Preimage that was pasted in there earlier: ![Screenshot 2024-06-11 at 10.47.03](https://hackmd.io/_uploads/r1MMJ9HSC.png) ## 4. Create Referendum - Go to Subsquare track 13: https://polkadot.subsquare.io/referenda/tracks/13 - Click on `New Proposal` - Paste in the preimage hash and length from above. This must be correct, otherwise it won't work! - It should eventually produce this event: ![Screenshot 2024-07-16 at 20.13.18](https://hackmd.io/_uploads/ryJI_VVuC.png) ## 5. Offboarding - Last step is to offboard the HA from the `Core` pallet after they were removed from the Collective with [AmbassadorCore::offboard(who)](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-collectives-polkadot.luckyfriday.io#/extrinsics/decode/0x49066c9e3102dd2c24274667d416e07570ebce6f20ab80ee3fc9917bf4a7568b8fd2). - Anyone can call this, but not root. Therefore you have to do this manually after the referendum passed. - It should produce an event like this. ![Screenshot 2024-07-16 at 20.04.22](https://hackmd.io/_uploads/B1GEIEE_R.png) ## 6. Testing - Clone the [moonbeam-tools](https://github.com/Moonsong-Labs/moonbeam-tools) repo. - Run a local chopstick fork of the Polkadot Relay and Collectives parachain with: `npx @acala-network/chopsticks@latest xcm -r polkadot -p polkadot-collectives`. For me locally this only works with `@0.12` instead of `@latest`, maybe a bug in Chopsticks. - Run the proposal with: `npx ts-node src/tools/fast-execute-chopstick-proposal.ts --url ws://localhost:8001 --proposal-index NUMBER` Be sure to replace`NUMBER` with your referendum index. - If you get a weird Javascript error, then try `npm install` first inside the repo. - After doing this, do the Offboarding step 5. - Check the state for `AmbassadorCore::members` and `AmbassadorCollective::members` that the HA was removed from both.