Skip to content

Commit

Permalink
Merge pull request #75 from Itheum/d-david
Browse files Browse the repository at this point in the history
Gas limit fix and base64 conversion fix
  • Loading branch information
newbreedofgeek authored Nov 16, 2023
2 parents 9b94a53 + e5d9135 commit f59be62
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 44 deletions.
135 changes: 95 additions & 40 deletions src/abis/data-nft-lease.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"buildInfo": {
"rustc": {
"version": "1.71.0-nightly",
"commitHash": "7f94b314cead7059a71a265a8b64905ef2511796",
"commitDate": "2023-04-23",
"commitHash": "a2b1646c597329d0a25efa3889b66650f65de1de",
"commitDate": "2023-05-25",
"channel": "Nightly",
"short": "rustc 1.71.0-nightly (7f94b314c 2023-04-23)"
"short": "rustc 1.71.0-nightly (a2b1646c5 2023-05-25)"
},
"contractCrate": {
"name": "data-nft-lease",
"version": "1.0.0"
},
"framework": {
"name": "multiversx-sc",
"version": "0.43.2"
"version": "0.43.5"
}
},
"name": "DataNftMint",
"constructor": {
"inputs": [
{
"name": "administrator",
"type": "optional<Address>",
"name": "setup_values",
"type": "optional<multi<Address,Address>>",
"multi_arg": true
}
],
Expand Down Expand Up @@ -196,7 +196,7 @@
"outputs": []
},
{
"name": "setAntiSpamTax",
"name": "setMintTaxFee",
"mutability": "mutable",
"inputs": [
{
Expand Down Expand Up @@ -294,26 +294,6 @@
],
"outputs": []
},
{
"name": "setTax",
"onlyOwner": true,
"mutability": "mutable",
"inputs": [
{
"name": "itheum_address",
"type": "Address"
},
{
"name": "tax",
"type": "BigUint"
}
],
"outputs": [
{
"type": "BigUint"
}
]
},
{
"name": "setClaimsAddress",
"mutability": "mutable",
Expand Down Expand Up @@ -375,6 +355,16 @@
}
]
},
{
"name": "getTaxTokens",
"mutability": "readonly",
"inputs": [],
"outputs": [
{
"type": "EgldOrEsdtTokenIdentifier"
}
]
},
{
"name": "getTaxIsRequired",
"mutability": "readonly",
Expand Down Expand Up @@ -561,17 +551,7 @@
]
},
{
"name": "getItheumTax",
"mutability": "readonly",
"inputs": [],
"outputs": [
{
"type": "BigUint"
}
]
},
{
"name": "getItheumTaxAddress",
"name": "getRoyaltiesAddress",
"mutability": "readonly",
"inputs": [],
"outputs": [
Expand All @@ -581,7 +561,7 @@
]
},
{
"name": "getClaimsAddress",
"name": "getFactoryAddress",
"mutability": "readonly",
"inputs": [],
"outputs": [
Expand Down Expand Up @@ -697,6 +677,67 @@
}
],
"outputs": []
},
{
"name": "check_claims",
"mutability": "mutable",
"inputs": [
{
"name": "address_to_check",
"type": "Address"
}
],
"outputs": [
{
"type": "BigUint"
}
]
},
{
"name": "get_claims",
"mutability": "mutable",
"inputs": [],
"outputs": []
},
{
"name": "factory_treasury_address",
"mutability": "mutable",
"inputs": [],
"outputs": [
{
"type": "Address"
}
]
},
{
"name": "factory_tax",
"mutability": "mutable",
"inputs": [],
"outputs": [
{
"type": "BigUint"
}
]
},
{
"name": "factory_claims_contract_address",
"mutability": "mutable",
"inputs": [],
"outputs": [
{
"type": "Address"
}
]
},
{
"name": "factory_claims_token_identifier",
"mutability": "mutable",
"inputs": [],
"outputs": [
{
"type": "TokenIdentifier"
}
]
}
],
"events": [
Expand Down Expand Up @@ -816,7 +857,7 @@
]
},
{
"identifier": "antiSpamTaxSet",
"identifier": "mintTaxFee",
"inputs": [
{
"name": "token",
Expand Down Expand Up @@ -860,6 +901,16 @@
}
]
},
{
"identifier": "setFactoryAddress",
"inputs": [
{
"name": "factory_address",
"type": "Address",
"indexed": true
}
]
},
{
"identifier": "pauseCollection",
"inputs": [
Expand Down Expand Up @@ -1039,6 +1090,10 @@
{
"name": "administrator_address",
"type": "Address"
},
{
"name": "tax_token",
"type": "EgldOrEsdtTokenIdentifier"
}
]
},
Expand Down
4 changes: 3 additions & 1 deletion src/datanft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ export class DataNft {
mvxNativeAuthOriginsToBase64 = mvxNativeAuthOriginsToBase64
.trim()
.replaceAll(' ', ''); // remove all spaces
mvxNativeAuthOriginsToBase64 = window.btoa(mvxNativeAuthOriginsToBase64); // convert to base64
mvxNativeAuthOriginsToBase64 = Buffer.from(
mvxNativeAuthOriginsToBase64
).toString('base64');

// construct the api url
let url = `${this.dataMarshal}/access?NFTId=${
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ export interface ContractConfiguration {
rolesAreSet: boolean;
claimsAddress: string;
administratorAddress: string;
taxToken: string;
}
2 changes: 1 addition & 1 deletion src/minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export abstract class Minter {
.setFunction(new ContractFunction('setLocalRoles'))
.build(),
receiver: this.contract.getAddress(),
gasLimit: 90000000,
gasLimit: 100000000,
sender: senderAddress,
chainID: this.chainID
});
Expand Down
5 changes: 3 additions & 2 deletions src/nft-minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class NftMinter extends Minter {
value: 50000000000000000,
data: data,
receiver: this.contract.getAddress(),
gasLimit: 50000000,
gasLimit: 100000000,
sender: senderAddress,
chainID: this.chainID
});
Expand Down Expand Up @@ -453,7 +453,8 @@ export class NftMinter extends Minter {
isContractPaused: returnValue?.is_paused as boolean,
rolesAreSet: returnValue?.roles_are_set as boolean,
claimsAddress: returnValue?.claims_address.toString(),
administratorAddress: returnValue?.administrator_address.toString()
administratorAddress: returnValue?.administrator_address.toString(),
taxToken: returnValue?.tax_token.toString()
};
return contractConfiguration;
} else {
Expand Down

0 comments on commit f59be62

Please sign in to comment.