-
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
ed40718
commit cbdc763
Showing
4 changed files
with
76 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { print, colors } from '../../utils/misc' | ||
import { callContractFunction } from '../../utils/write-contract' | ||
import { etherPerDayToWeiPerSecond } from '../../utils/bignumber' | ||
import { EMPTY_BYTES, ONE_DAY } from '../../utils/constants' | ||
import { USER_ROLE_MOONBEAM } from '../../utils/roles' | ||
import { RentalOffer } from '../../utils/types' | ||
|
||
const CONTRACT_NAME = 'NftRentalMarketplace' | ||
const CONTRACT_FUNCTION = 'acceptRentalOffer' | ||
|
||
async function main() { | ||
const RENTAL_OFFER: RentalOffer = { | ||
nonce: '115457453593754985652281111685552019968813348573560119211069111442109350087626', | ||
lender: '0xe3A75c99cD21674188bea652Fe378cA5cf7e7906', | ||
borrower: '0xe3A75c99cD21674188bea652Fe378cA5cf7e7906', | ||
tokenId: 1994, | ||
tokenAddress: '0xcb13945ca8104f813992e4315f8ffefe64ac49ca', // GLMR jungle address | ||
feeTokenAddress: '0xd10078fdbc835726c79533a4a19db40cfad69d7f', // GLMB address | ||
feeAmountPerSecond: etherPerDayToWeiPerSecond('0'), | ||
deadline: 1714599894, | ||
minDuration: 0, | ||
roles: [USER_ROLE_MOONBEAM], | ||
rolesData: [EMPTY_BYTES], | ||
} | ||
const DURATION = ONE_DAY / 2 | ||
await callContractFunction(CONTRACT_NAME, CONTRACT_FUNCTION, [RENTAL_OFFER, DURATION]) | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { print, colors } from '../../utils/misc' | ||
import { callContractFunction } from '../../utils/write-contract' | ||
import { etherPerDayToWeiPerSecond } from '../../utils/bignumber' | ||
import { EMPTY_BYTES } from '../../utils/constants' | ||
import { USER_ROLE_MOONBEAM } from '../../utils/roles' | ||
import { RentalOffer } from '../../utils/types' | ||
|
||
const CONTRACT_NAME = 'NftRentalMarketplace' | ||
const CONTRACT_FUNCTION = 'cancelRentalOffer' | ||
|
||
async function main() { | ||
const RENTAL_OFFER: RentalOffer = { | ||
nonce: '41073076454465649804684789998370311225937584494094599799884085085462612297440', | ||
lender: '0xe3A75c99cD21674188bea652Fe378cA5cf7e7906', | ||
borrower: '0xe3A75c99cD21674188bea652Fe378cA5cf7e7906', | ||
tokenId: 1994, | ||
tokenAddress: '0xcb13945ca8104f813992e4315f8ffefe64ac49ca', // GLMR jungle address | ||
feeTokenAddress: '0xd10078fdbc835726c79533a4a19db40cfad69d7f', // GLMB address | ||
feeAmountPerSecond: etherPerDayToWeiPerSecond('0'), | ||
deadline: 1714599360, | ||
minDuration: 0, | ||
roles: [USER_ROLE_MOONBEAM], | ||
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