forked from storyprotocol/protocol-core-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add grouping IPA tests (storyprotocol#335)
- Loading branch information
Showing
5 changed files
with
182 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Purpose: Helper functions for licensing config and registering PIL terms functions | ||
|
||
import hre from "hardhat"; | ||
import { EvenSplitGroupPool, MockERC20, PILicenseTemplate } from "../constants"; | ||
import { terms } from "../licenseTermsTemplate"; | ||
|
||
export const LicensingConfig = ({ | ||
isSet: true, | ||
mintingFee: 20, | ||
licensingHook: hre.ethers.ZeroAddress, | ||
hookData: "0x", | ||
commercialRevShare: 10 * 10 ** 6, | ||
disabled: false, | ||
expectMinimumGroupRewardShare: 0, | ||
expectGroupRewardPool: EvenSplitGroupPool, | ||
}); | ||
|
||
export async function registerPILTerms( | ||
commercialUse: boolean = false, | ||
mintingFee: number = 0, | ||
commercialRevShare: number = 0, | ||
royaltyPolicy: string = hre.ethers.ZeroAddress, | ||
currencyToken: string = MockERC20): Promise<number> { | ||
|
||
const licenseTemplate = await hre.ethers.getContractAt("PILicenseTemplate", PILicenseTemplate); | ||
|
||
const testTerms = terms; | ||
testTerms.royaltyPolicy = royaltyPolicy; | ||
testTerms.defaultMintingFee = mintingFee; | ||
testTerms.commercialUse = commercialUse; | ||
testTerms.commercialRevShare = commercialRevShare; | ||
testTerms.currency = currencyToken; | ||
|
||
await licenseTemplate.registerLicenseTerms(testTerms).then((tx) => tx.wait()); | ||
const licenseTermsId = await licenseTemplate.getLicenseTermsId(testTerms); | ||
console.log("licenseTermsId", licenseTermsId); | ||
|
||
return licenseTermsId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters