-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Lima
committed
Apr 30, 2024
1 parent
7f3ab81
commit ed40718
Showing
9 changed files
with
87 additions
and
27 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
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 @@ | ||
import { ZeroAddress } from 'ethers' | ||
import { print, colors } from '../../utils/misc' | ||
import { callContractFunction } from '../../utils/write-contract' | ||
import { randomBytes } from 'crypto' | ||
import { etherPerDayToWeiPerSecond } from '../../utils/bignumber' | ||
import { EMPTY_BYTES, ONE_DAY } from '../../utils/constants' | ||
import { USER_ROLE } from '../../utils/roles' | ||
import { ethers } from 'hardhat' | ||
import { RentalOffer } from '../../utils/types' | ||
|
||
const CONTRACT_NAME = 'NftRentalMarketplace' | ||
const CONTRACT_FUNCTION = 'createRentalOffer' | ||
|
||
async function main() { | ||
const blockTimestamp = (await ethers.provider.getBlock('latest'))!.timestamp | ||
const RENTAL_OFFER: RentalOffer = { | ||
nonce: `0x${randomBytes(32).toString('hex')}`, | ||
lender: '0xe3A75c99cD21674188bea652Fe378cA5cf7e7906', | ||
borrower: ZeroAddress, | ||
tokenId: 1994, | ||
tokenAddress: '0xcb13945ca8104f813992e4315f8ffefe64ac49ca', // GLMR jungle address | ||
feeTokenAddress: '0xd10078fdbc835726c79533a4a19db40cfad69d7f', // GLMB address | ||
feeAmountPerSecond: etherPerDayToWeiPerSecond('0.01'), | ||
deadline: blockTimestamp + ONE_DAY, | ||
minDuration: 0, | ||
roles: [USER_ROLE], | ||
rolesData: [EMPTY_BYTES], | ||
} | ||
await callContractFunction(CONTRACT_NAME, CONTRACT_FUNCTION, [RENTAL_OFFER]) | ||
} | ||
|
||
main() | ||
.then(() => { | ||
print(colors.bigSuccess, 'All done!') | ||
}) | ||
.catch(error => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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
3 changes: 2 additions & 1 deletion
3
...09-set-default-nft-roles-registry copy.ts → ...ties/09-set-default-nft-roles-registry.ts
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
22 changes: 22 additions & 0 deletions
22
scripts/orium-marketplace-royalties/10-set-roles-registry.ts
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,22 @@ | ||
import { kmsDeployer } from '../../utils/deployer' | ||
import { print, colors } from '../../utils/misc' | ||
import { callContractFunction } from '../../utils/write-contract' | ||
|
||
const CONTRACT_NAME = 'OriumMarketplaceRoyalties' | ||
const CONTRACT_FUNCTION = 'setRolesRegistry' | ||
const TOKEN_ADDRESS = '0xcb13945ca8104f813992e4315f8ffefe64ac49ca' | ||
const ROLES_REGISTRY = '0xc3154ccac181eb9d71ccd53f29f425bddd52d983' | ||
const CONTRACT_ARGUMENTS = [TOKEN_ADDRESS, ROLES_REGISTRY] | ||
|
||
async function main() { | ||
await callContractFunction(CONTRACT_NAME, CONTRACT_FUNCTION, CONTRACT_ARGUMENTS, kmsDeployer as any) | ||
} | ||
|
||
main() | ||
.then(() => { | ||
print(colors.bigSuccess, 'All done!') | ||
}) | ||
.catch(error => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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