Change a library is one of the actions that a smart contract can perform during the action phase. It adds libraries to or removes them from the collection of libraries of this smart contract. It can be appended to an out action list by:Documentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-closes-1950-ai-ai-ai-ai-ai-ai-ai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- The
SETLIBCODEinstruction. - The
CHANGELIBinstruction. - The
POPCTRinstruction.
- a 7-bit bitmask
modespecifying the way of changing the library; - a ref to a cell containing the new library code or the hash of this code as an unsigned 256-bit integer.
Modes
Themode can have the following values that can be combined together:
| Mode value | Convenient name | Description |
|---|---|---|
0 | RemoveLibrary | Default mode. Removes library if it was in the collection. Otherwise, action does nothing. |
+1 | AddPrivateLibrary | A library is added as a private library. |
+2 | AddPublicLibrary | A library is added as a public library and becomes available to all smart contracts in all workchains if the current smart contract resides in the masterchain. If current contract is in other workchain, works as AddPrivateLibrary. |
+16 | BounceOnFail | Bounces the transaction if the action fails. |
mode are invalid and lead to an error. Simultaneous usage of the AddPrivateLibrary and AddPublicLibrary modes also leads to an error. If the library was present in the collection before, its public/private status is changed according to the mode.