> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datafdn.org/llms.txt
> Use this file to discover all available pages before exploring further.

# License Config

> 동적 발행 수수료 및 사용자 정의 로직을 위해 특정 라이선스에 첨부할 수 있는 선택적 구성입니다.

## License Config

<CardGroup cols={1}>
  <Card title="LicensingConfig 구조체" href="https://github.com/thedatafoundation/protocol-core-v1/blob/main/contracts/lib/Licensing.sol" icon="scroll" color="#ccb092">
    스마트 컨트랙트의 LicensingConfig 구조체를 확인하세요.
  </Card>
</CardGroup>

선택적으로, IP Asset(해당 asset에 첨부된 특정 `licenseTermsId`에 대해)에 `LicensingConfig`를 첨부할 수 있으며, 아래와 같이 `mintingFee` 및 `licensingHook` 같은 필드를 포함합니다.

```solidity theme={null}
/// @notice This struct is used by IP owners to define the configuration
/// when others are minting license tokens of their IP through the LicensingModule.
/// When the `mintLicenseTokens` function of LicensingModule is called, the LicensingModule will read
/// this configuration to determine the minting fee and execute the licensing hook if set.
/// IP owners can set these configurations for each License or set the configuration for the IP
/// so that the configuration applies to all licenses of the IP.
/// If both the license and IP have the configuration, then the license configuration takes precedence.
/// @param isSet Whether the configuration is set or not.
/// @param mintingFee The minting fee to be paid when minting license tokens.
/// @param licensingHook  The hook contract address for the licensing module, or address(0) if none
/// @param hookData The data to be used by the licensing hook.
/// @param commercialRevShare The commercial revenue share percentage.
/// @param disabled Whether the license is disabled or not.
/// @param expectMinimumGroupRewardShare The minimum percentage of the group's reward share
/// (from 0 to 100%, represented as 100 * 10 ** 6) that can be allocated to the IP when it is added to the group.
/// If the remaining reward share in the group is less than the minimumGroupRewardShare,
/// the IP cannot be added to the group.
/// @param expectGroupRewardPool The address of the expected group reward pool.
/// The IP can only be added to a group with this specified reward pool address,
/// or address(0) if the IP does not want to be added to any group.
struct LicensingConfig {
  bool isSet;
  uint256 mintingFee;
  address licensingHook;
  bytes hookData;
  uint32 commercialRevShare;
  bool disabled;
  uint32 expectMinimumGroupRewardShare;
  address expectGroupRewardPool;
}
```

이 중 몇 가지는 무엇을 의미할까요?

1. `isSet` - 이것이 false이면, 전체 licensing config는 완전히 무시됩니다. 예를 들어, licensing config의 `mintingFee == 10`이고 `disabled == true`이지만 `isSet == false`이면, `mintingFee`와 `disabled`는 완전히 무시됩니다.
2. `disabled` - 이것이 true이면, config가 첨부된 조건에 대해 라이선스를 발행할 수 없고 더 이상 파생물도 첨부할 수 없습니다.

`mintingFee`와 `commercialRevShare` 같은 필드는 라이선스 조건 자체의 중복 필드를 덮어씁니다. **이것의 이점은 일반적으로 라이선스 조건을 변경할 수 없는 파생 IP Asset이 특정 필드를 덮어쓸 수 있다는 점입니다.**

`licensingHook`은 `ILicensingHook` 인터페이스를 구현하는 스마트 컨트랙트의 주소로, 사용자가 License Token을 발행하기 전에 실행되는 `beforeMintLicenseTokens` 함수를 포함합니다. 이는 라이선스 발행 시 실행될 로직을 삽입할 수 있음을 의미합니다.

hook 자체는 다른 섹션에서 설명됩니다. 라이선스에 대한 정보, License Token을 발행하는 사람, 받는 사람에 대한 정보를 포함하고 있음을 알 수 있습니다.

<Tip>
  Licensing Hooks에 대한 모든 내용은 [여기](/concepts/hooks#licensing-hooks)에서 알아보세요.
</Tip>

### License Config 설정

[LicensingModule.sol 컨트랙트](https://github.com/thedatafoundation/protocol-core-v1/blob/main/contracts/modules/licensing/LicensingModule.sol)에서 `setLicenseConfig` 함수를 호출하여 License Config를 설정할 수 있습니다.

### License Config로 가능한 로직

1. **최대 라이선스 수**: `licensingHook`(다음 섹션에서 설명)는 발행할 수 있는 최대 라이선스 수에 대한 로직을 정의할 수 있는 곳입니다. 예를 들어, 최대 라이선스 수가 이미 발행된 경우 트랜잭션을 되돌릴 수 있습니다.
2. **파생물 금지**: IP Asset의 파생물을 등록하면, 해당 파생물은 [여기](/concepts/licensing-module/license-terms#inherited-license-terms)에 설명된 대로 라이선스 조건을 변경할 수 없습니다. "내가 파생물로서 내 자신의 파생물을 금지하고 싶지만 내 라이선스 조건이 파생물을 허용하고 이를 변경할 수 없다면 어떻게 하지?"라고 궁금해할 수 있습니다. 이를 해결하려면 단순히 `disabled`를 true로 설정하면 됩니다.
3. **발행 수수료**: 위 #2와 비슷한데... 발행 수수료는 어떨까요? 파생 IP Asset에서 라이선스 조건(따라서 그 안의 발행 수수료)을 변경할 수는 없지만, License Config의 `mintingFee`를 수정하거나 `licensingHook`(다음 섹션에서 설명)에서 `totalMintingFee`를 반환하여 해당 파생물의 발행 수수료를 변경할 수 있습니다.
4. **상업적 수익 분배**: 위 #2 및 #3과 비슷하게, License Config의 `commercialRevShare`를 수정할 수 있습니다.
5. **License Token 발행에 대한 동적 가격 책정**: 총 발행된 수, 사용자가 발행하는 라이선스 수, 심지어 사용자가 누구인지에 따라 IP Asset에서 License Token을 발행하기 위한 동적 가격을 설정합니다. 이 모든 데이터는 `licensingHook`(다음 섹션에서 설명)에서 사용할 수 있습니다.

... 그리고 그 외 더 많은 것들이 있습니다.

### 제한 사항

License Config 설정에 대한 다양한 제한 사항은 [IP 수정 및 제한](/concepts/ip-asset/ipa-modifications)을 참조하세요.
