difftreelog
Merge pull request #598 from UniqueNetwork/fix/rename_method_to_collectionSponsor
in: master
24 files changed
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -194,7 +194,7 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_collection_sponsor(&self) -> Result<(address, uint256)> {
+ fn collection_sponsor(&self) -> Result<(address, uint256)> {
let sponsor = match self.collection.sponsorship.sponsor() {
Some(sponsor) => sponsor,
None => return Ok(Default::default()),
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -169,7 +169,7 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
+ fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
let sponsor =
Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
@@ -220,7 +220,7 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
+ fn sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
self.recorder().consume_sload()?;
Ok(<SponsoringRateLimit<T>>::get(contract_address)
@@ -273,7 +273,7 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
+ fn sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
self.recorder().consume_sload()?;
Ok(get_sponsoring_fee_limit::<T>(contract_address))
pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -24,15 +20,12 @@
/// @dev inlined interface
contract ContractHelpersEvents {
event ContractSponsorSet(address indexed contractAddress, address sponsor);
- event ContractSponsorshipConfirmed(
- address indexed contractAddress,
- address sponsor
- );
+ event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);
event ContractSponsorRemoved(address indexed contractAddress);
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -43,11 +36,7 @@
/// @return address Owner of contract
/// @dev EVM selector for this function is: 0x5152b14c,
/// or in textual repr: contractOwner(address)
- function contractOwner(address contractAddress)
- public
- view
- returns (address)
- {
+ function contractOwner(address contractAddress) public view returns (address) {
require(false, stub_error);
contractAddress;
dummy;
@@ -105,13 +94,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress)
- public
- view
- returns (Tuple0 memory)
- {
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) public view returns (Tuple0 memory) {
require(false, stub_error);
contractAddress;
dummy;
@@ -137,11 +122,7 @@
/// @return **true** if contract has pending sponsor.
/// @dev EVM selector for this function is: 0x39b9b242,
/// or in textual repr: hasPendingSponsor(address)
- function hasPendingSponsor(address contractAddress)
- public
- view
- returns (bool)
- {
+ function hasPendingSponsor(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
@@ -150,11 +131,7 @@
/// @dev EVM selector for this function is: 0x6027dc61,
/// or in textual repr: sponsoringEnabled(address)
- function sponsoringEnabled(address contractAddress)
- public
- view
- returns (bool)
- {
+ function sponsoringEnabled(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
@@ -173,13 +150,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress)
- public
- view
- returns (uint32)
- {
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) public view returns (uint32) {
require(false, stub_error);
contractAddress;
dummy;
@@ -194,9 +167,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x77b6c908,
/// or in textual repr: setSponsoringRateLimit(address,uint32)
- function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
- public
- {
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public {
require(false, stub_error);
contractAddress;
rateLimit;
@@ -211,9 +182,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x03aed665,
/// or in textual repr: setSponsoringFeeLimit(address,uint256)
- function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
- public
- {
+ function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public {
require(false, stub_error);
contractAddress;
feeLimit;
@@ -224,13 +193,9 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress)
- public
- view
- returns (uint256)
- {
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) public view returns (uint256) {
require(false, stub_error);
contractAddress;
dummy;
@@ -244,11 +209,7 @@
/// @return bool Is specified users exists in contract allowlist
/// @dev EVM selector for this function is: 0x5c658165,
/// or in textual repr: allowed(address,address)
- function allowed(address contractAddress, address user)
- public
- view
- returns (bool)
- {
+ function allowed(address contractAddress, address user) public view returns (bool) {
require(false, stub_error);
contractAddress;
user;
@@ -284,11 +245,7 @@
/// @return bool Is specified contract has allowlist access enabled
/// @dev EVM selector for this function is: 0xc772ef6c,
/// or in textual repr: allowlistEnabled(address)
- function allowlistEnabled(address contractAddress)
- public
- view
- returns (bool)
- {
+ function allowlistEnabled(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8 uint8 dummy;9 string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13 function supportsInterface(bytes4 interfaceID)14 external15 view16 returns (bool)17 {18 require(false, stub_error);19 interfaceID;20 return true;21 }22}2324/// @title A contract that allows you to work with collections.25/// @dev the ERC-165 identifier for this interface is 0x9f70d4e026contract Collection is Dummy, ERC165 {27 /// Set collection property.28 ///29 /// @param key Property key.30 /// @param value Propery value.31 /// @dev EVM selector for this function is: 0x2f073f66,32 /// or in textual repr: setCollectionProperty(string,bytes)33 function setCollectionProperty(string memory key, bytes memory value)34 public35 {36 require(false, stub_error);37 key;38 value;39 dummy = 0;40 }4142 /// Delete collection property.43 ///44 /// @param key Property key.45 /// @dev EVM selector for this function is: 0x7b7debce,46 /// or in textual repr: deleteCollectionProperty(string)47 function deleteCollectionProperty(string memory key) public {48 require(false, stub_error);49 key;50 dummy = 0;51 }5253 /// Get collection property.54 ///55 /// @dev Throws error if key not found.56 ///57 /// @param key Property key.58 /// @return bytes The property corresponding to the key.59 /// @dev EVM selector for this function is: 0xcf24fd6d,60 /// or in textual repr: collectionProperty(string)61 function collectionProperty(string memory key)62 public63 view64 returns (bytes memory)65 {66 require(false, stub_error);67 key;68 dummy;69 return hex"";70 }7172 /// Set the sponsor of the collection.73 ///74 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.75 ///76 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.77 /// @dev EVM selector for this function is: 0x7623402e,78 /// or in textual repr: setCollectionSponsor(address)79 function setCollectionSponsor(address sponsor) public {80 require(false, stub_error);81 sponsor;82 dummy = 0;83 }8485 /// Set the substrate sponsor of the collection.86 ///87 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.88 ///89 /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract.90 /// @dev EVM selector for this function is: 0xc74d6751,91 /// or in textual repr: setCollectionSponsorSubstrate(uint256)92 function setCollectionSponsorSubstrate(uint256 sponsor) public {93 require(false, stub_error);94 sponsor;95 dummy = 0;96 }9798 /// @dev EVM selector for this function is: 0x058ac185,99 /// or in textual repr: hasCollectionPendingSponsor()100 function hasCollectionPendingSponsor() public view returns (bool) {101 require(false, stub_error);102 dummy;103 return false;104 }105106 /// Collection sponsorship confirmation.107 ///108 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.109 /// @dev EVM selector for this function is: 0x3c50e97a,110 /// or in textual repr: confirmCollectionSponsorship()111 function confirmCollectionSponsorship() public {112 require(false, stub_error);113 dummy = 0;114 }115116 /// Remove collection sponsor.117 /// @dev EVM selector for this function is: 0x6e0326a3,118 /// or in textual repr: removeCollectionSponsor()119 function removeCollectionSponsor() public {120 require(false, stub_error);121 dummy = 0;122 }123124 /// Get current sponsor.125 ///126 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.127 /// @dev EVM selector for this function is: 0xb66bbc14,128 /// or in textual repr: getCollectionSponsor()129 function getCollectionSponsor() public view returns (Tuple6 memory) {130 require(false, stub_error);131 dummy;132 return Tuple6(0x0000000000000000000000000000000000000000, 0);133 }134135 /// Set limits for the collection.136 /// @dev Throws error if limit not found.137 /// @param limit Name of the limit. Valid names:138 /// "accountTokenOwnershipLimit",139 /// "sponsoredDataSize",140 /// "sponsoredDataRateLimit",141 /// "tokenLimit",142 /// "sponsorTransferTimeout",143 /// "sponsorApproveTimeout"144 /// @param value Value of the limit.145 /// @dev EVM selector for this function is: 0x6a3841db,146 /// or in textual repr: setCollectionLimit(string,uint32)147 function setCollectionLimit(string memory limit, uint32 value) public {148 require(false, stub_error);149 limit;150 value;151 dummy = 0;152 }153154 /// Set limits for the collection.155 /// @dev Throws error if limit not found.156 /// @param limit Name of the limit. Valid names:157 /// "ownerCanTransfer",158 /// "ownerCanDestroy",159 /// "transfersEnabled"160 /// @param value Value of the limit.161 /// @dev EVM selector for this function is: 0x993b7fba,162 /// or in textual repr: setCollectionLimit(string,bool)163 function setCollectionLimit(string memory limit, bool value) public {164 require(false, stub_error);165 limit;166 value;167 dummy = 0;168 }169170 /// Get contract address.171 /// @dev EVM selector for this function is: 0xf6b4dfb4,172 /// or in textual repr: contractAddress()173 function contractAddress() public view returns (address) {174 require(false, stub_error);175 dummy;176 return 0x0000000000000000000000000000000000000000;177 }178179 /// Add collection admin by substrate address.180 /// @param newAdmin Substrate administrator address.181 /// @dev EVM selector for this function is: 0x5730062b,182 /// or in textual repr: addCollectionAdminSubstrate(uint256)183 function addCollectionAdminSubstrate(uint256 newAdmin) public {184 require(false, stub_error);185 newAdmin;186 dummy = 0;187 }188189 /// Remove collection admin by substrate address.190 /// @param admin Substrate administrator address.191 /// @dev EVM selector for this function is: 0x4048fcf9,192 /// or in textual repr: removeCollectionAdminSubstrate(uint256)193 function removeCollectionAdminSubstrate(uint256 admin) public {194 require(false, stub_error);195 admin;196 dummy = 0;197 }198199 /// Add collection admin.200 /// @param newAdmin Address of the added administrator.201 /// @dev EVM selector for this function is: 0x92e462c7,202 /// or in textual repr: addCollectionAdmin(address)203 function addCollectionAdmin(address newAdmin) public {204 require(false, stub_error);205 newAdmin;206 dummy = 0;207 }208209 /// Remove collection admin.210 ///211 /// @param admin Address of the removed administrator.212 /// @dev EVM selector for this function is: 0xfafd7b42,213 /// or in textual repr: removeCollectionAdmin(address)214 function removeCollectionAdmin(address admin) public {215 require(false, stub_error);216 admin;217 dummy = 0;218 }219220 /// Toggle accessibility of collection nesting.221 ///222 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'223 /// @dev EVM selector for this function is: 0x112d4586,224 /// or in textual repr: setCollectionNesting(bool)225 function setCollectionNesting(bool enable) public {226 require(false, stub_error);227 enable;228 dummy = 0;229 }230231 /// Toggle accessibility of collection nesting.232 ///233 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'234 /// @param collections Addresses of collections that will be available for nesting.235 /// @dev EVM selector for this function is: 0x64872396,236 /// or in textual repr: setCollectionNesting(bool,address[])237 function setCollectionNesting(bool enable, address[] memory collections)238 public239 {240 require(false, stub_error);241 enable;242 collections;243 dummy = 0;244 }245246 /// Set the collection access method.247 /// @param mode Access mode248 /// 0 for Normal249 /// 1 for AllowList250 /// @dev EVM selector for this function is: 0x41835d4c,251 /// or in textual repr: setCollectionAccess(uint8)252 function setCollectionAccess(uint8 mode) public {253 require(false, stub_error);254 mode;255 dummy = 0;256 }257258 /// Checks that user allowed to operate with collection.259 ///260 /// @param user User address to check.261 /// @dev EVM selector for this function is: 0xd63a8e11,262 /// or in textual repr: allowed(address)263 function allowed(address user) public view returns (bool) {264 require(false, stub_error);265 user;266 dummy;267 return false;268 }269270 /// Add the user to the allowed list.271 ///272 /// @param user Address of a trusted user.273 /// @dev EVM selector for this function is: 0x67844fe6,274 /// or in textual repr: addToCollectionAllowList(address)275 function addToCollectionAllowList(address user) public {276 require(false, stub_error);277 user;278 dummy = 0;279 }280281 /// Add substrate user to allowed list.282 ///283 /// @param user User substrate address.284 /// @dev EVM selector for this function is: 0xd06ad267,285 /// or in textual repr: addToCollectionAllowListSubstrate(uint256)286 function addToCollectionAllowListSubstrate(uint256 user) public {287 require(false, stub_error);288 user;289 dummy = 0;290 }291292 /// Remove the user from the allowed list.293 ///294 /// @param user Address of a removed user.295 /// @dev EVM selector for this function is: 0x85c51acb,296 /// or in textual repr: removeFromCollectionAllowList(address)297 function removeFromCollectionAllowList(address user) public {298 require(false, stub_error);299 user;300 dummy = 0;301 }302303 /// Remove substrate user from allowed list.304 ///305 /// @param user User substrate address.306 /// @dev EVM selector for this function is: 0xa31913ed,307 /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256)308 function removeFromCollectionAllowListSubstrate(uint256 user) public {309 require(false, stub_error);310 user;311 dummy = 0;312 }313314 /// Switch permission for minting.315 ///316 /// @param mode Enable if "true".317 /// @dev EVM selector for this function is: 0x00018e84,318 /// or in textual repr: setCollectionMintMode(bool)319 function setCollectionMintMode(bool mode) public {320 require(false, stub_error);321 mode;322 dummy = 0;323 }324325 /// Check that account is the owner or admin of the collection326 ///327 /// @param user account to verify328 /// @return "true" if account is the owner or admin329 /// @dev EVM selector for this function is: 0x9811b0c7,330 /// or in textual repr: isOwnerOrAdmin(address)331 function isOwnerOrAdmin(address user) public view returns (bool) {332 require(false, stub_error);333 user;334 dummy;335 return false;336 }337338 /// Check that substrate account is the owner or admin of the collection339 ///340 /// @param user account to verify341 /// @return "true" if account is the owner or admin342 /// @dev EVM selector for this function is: 0x68910e00,343 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)344 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {345 require(false, stub_error);346 user;347 dummy;348 return false;349 }350351 /// Returns collection type352 ///353 /// @return `Fungible` or `NFT` or `ReFungible`354 /// @dev EVM selector for this function is: 0xd34b55b8,355 /// or in textual repr: uniqueCollectionType()356 function uniqueCollectionType() public returns (string memory) {357 require(false, stub_error);358 dummy = 0;359 return "";360 }361362 /// Get collection owner.363 ///364 /// @return Tuble with sponsor address and his substrate mirror.365 /// If address is canonical then substrate mirror is zero and vice versa.366 /// @dev EVM selector for this function is: 0xdf727d3b,367 /// or in textual repr: collectionOwner()368 function collectionOwner() public view returns (Tuple6 memory) {369 require(false, stub_error);370 dummy;371 return Tuple6(0x0000000000000000000000000000000000000000, 0);372 }373374 /// Changes collection owner to another account375 ///376 /// @dev Owner can be changed only by current owner377 /// @param newOwner new owner account378 /// @dev EVM selector for this function is: 0x13af4035,379 /// or in textual repr: setOwner(address)380 function setOwner(address newOwner) public {381 require(false, stub_error);382 newOwner;383 dummy = 0;384 }385386 /// Changes collection owner to another substrate account387 ///388 /// @dev Owner can be changed only by current owner389 /// @param newOwner new owner substrate account390 /// @dev EVM selector for this function is: 0xb212138f,391 /// or in textual repr: setOwnerSubstrate(uint256)392 function setOwnerSubstrate(uint256 newOwner) public {393 require(false, stub_error);394 newOwner;395 dummy = 0;396 }397}398399/// @dev the ERC-165 identifier for this interface is 0x63034ac5400contract ERC20UniqueExtensions is Dummy, ERC165 {401 /// Burn tokens from account402 /// @dev Function that burns an `amount` of the tokens of a given account,403 /// deducting from the sender's allowance for said account.404 /// @param from The account whose tokens will be burnt.405 /// @param amount The amount that will be burnt.406 /// @dev EVM selector for this function is: 0x79cc6790,407 /// or in textual repr: burnFrom(address,uint256)408 function burnFrom(address from, uint256 amount) public returns (bool) {409 require(false, stub_error);410 from;411 amount;412 dummy = 0;413 return false;414 }415416 /// Mint tokens for multiple accounts.417 /// @param amounts array of pairs of account address and amount418 /// @dev EVM selector for this function is: 0x1acf2d55,419 /// or in textual repr: mintBulk((address,uint256)[])420 function mintBulk(Tuple6[] memory amounts) public returns (bool) {421 require(false, stub_error);422 amounts;423 dummy = 0;424 return false;425 }426}427428/// @dev anonymous struct429struct Tuple6 {430 address field_0;431 uint256 field_1;432}433434/// @dev the ERC-165 identifier for this interface is 0x40c10f19435contract ERC20Mintable is Dummy, ERC165 {436 /// Mint tokens for `to` account.437 /// @param to account that will receive minted tokens438 /// @param amount amount of tokens to mint439 /// @dev EVM selector for this function is: 0x40c10f19,440 /// or in textual repr: mint(address,uint256)441 function mint(address to, uint256 amount) public returns (bool) {442 require(false, stub_error);443 to;444 amount;445 dummy = 0;446 return false;447 }448}449450/// @dev inlined interface451contract ERC20Events {452 event Transfer(address indexed from, address indexed to, uint256 value);453 event Approval(454 address indexed owner,455 address indexed spender,456 uint256 value457 );458}459460/// @dev the ERC-165 identifier for this interface is 0x942e8b22461contract ERC20 is Dummy, ERC165, ERC20Events {462 /// @dev EVM selector for this function is: 0x06fdde03,463 /// or in textual repr: name()464 function name() public view returns (string memory) {465 require(false, stub_error);466 dummy;467 return "";468 }469470 /// @dev EVM selector for this function is: 0x95d89b41,471 /// or in textual repr: symbol()472 function symbol() public view returns (string memory) {473 require(false, stub_error);474 dummy;475 return "";476 }477478 /// @dev EVM selector for this function is: 0x18160ddd,479 /// or in textual repr: totalSupply()480 function totalSupply() public view returns (uint256) {481 require(false, stub_error);482 dummy;483 return 0;484 }485486 /// @dev EVM selector for this function is: 0x313ce567,487 /// or in textual repr: decimals()488 function decimals() public view returns (uint8) {489 require(false, stub_error);490 dummy;491 return 0;492 }493494 /// @dev EVM selector for this function is: 0x70a08231,495 /// or in textual repr: balanceOf(address)496 function balanceOf(address owner) public view returns (uint256) {497 require(false, stub_error);498 owner;499 dummy;500 return 0;501 }502503 /// @dev EVM selector for this function is: 0xa9059cbb,504 /// or in textual repr: transfer(address,uint256)505 function transfer(address to, uint256 amount) public returns (bool) {506 require(false, stub_error);507 to;508 amount;509 dummy = 0;510 return false;511 }512513 /// @dev EVM selector for this function is: 0x23b872dd,514 /// or in textual repr: transferFrom(address,address,uint256)515 function transferFrom(516 address from,517 address to,518 uint256 amount519 ) public returns (bool) {520 require(false, stub_error);521 from;522 to;523 amount;524 dummy = 0;525 return false;526 }527528 /// @dev EVM selector for this function is: 0x095ea7b3,529 /// or in textual repr: approve(address,uint256)530 function approve(address spender, uint256 amount) public returns (bool) {531 require(false, stub_error);532 spender;533 amount;534 dummy = 0;535 return false;536 }537538 /// @dev EVM selector for this function is: 0xdd62ed3e,539 /// or in textual repr: allowance(address,address)540 function allowance(address owner, address spender)541 public542 view543 returns (uint256)544 {545 require(false, stub_error);546 owner;547 spender;548 dummy;549 return 0;550 }551}552553contract UniqueFungible is554 Dummy,555 ERC165,556 ERC20,557 ERC20Mintable,558 ERC20UniqueExtensions,559 Collection560{}1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8 uint8 dummy;9 string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13 function supportsInterface(bytes4 interfaceID) external view returns (bool) {14 require(false, stub_error);15 interfaceID;16 return true;17 }18}1920/// @title A contract that allows you to work with collections.21/// @dev the ERC-165 identifier for this interface is 0x47dbc10522contract Collection is Dummy, ERC165 {23 /// Set collection property.24 ///25 /// @param key Property key.26 /// @param value Propery value.27 /// @dev EVM selector for this function is: 0x2f073f66,28 /// or in textual repr: setCollectionProperty(string,bytes)29 function setCollectionProperty(string memory key, bytes memory value) public {30 require(false, stub_error);31 key;32 value;33 dummy = 0;34 }3536 /// Delete collection property.37 ///38 /// @param key Property key.39 /// @dev EVM selector for this function is: 0x7b7debce,40 /// or in textual repr: deleteCollectionProperty(string)41 function deleteCollectionProperty(string memory key) public {42 require(false, stub_error);43 key;44 dummy = 0;45 }4647 /// Get collection property.48 ///49 /// @dev Throws error if key not found.50 ///51 /// @param key Property key.52 /// @return bytes The property corresponding to the key.53 /// @dev EVM selector for this function is: 0xcf24fd6d,54 /// or in textual repr: collectionProperty(string)55 function collectionProperty(string memory key) public view returns (bytes memory) {56 require(false, stub_error);57 key;58 dummy;59 return hex"";60 }6162 /// Set the sponsor of the collection.63 ///64 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.65 ///66 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.67 /// @dev EVM selector for this function is: 0x7623402e,68 /// or in textual repr: setCollectionSponsor(address)69 function setCollectionSponsor(address sponsor) public {70 require(false, stub_error);71 sponsor;72 dummy = 0;73 }7475 /// Set the substrate sponsor of the collection.76 ///77 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.78 ///79 /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract.80 /// @dev EVM selector for this function is: 0xc74d6751,81 /// or in textual repr: setCollectionSponsorSubstrate(uint256)82 function setCollectionSponsorSubstrate(uint256 sponsor) public {83 require(false, stub_error);84 sponsor;85 dummy = 0;86 }8788 /// Whether there is a pending sponsor.89 /// @dev EVM selector for this function is: 0x058ac185,90 /// or in textual repr: hasCollectionPendingSponsor()91 function hasCollectionPendingSponsor() public view returns (bool) {92 require(false, stub_error);93 dummy;94 return false;95 }9697 /// Collection sponsorship confirmation.98 ///99 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.100 /// @dev EVM selector for this function is: 0x3c50e97a,101 /// or in textual repr: confirmCollectionSponsorship()102 function confirmCollectionSponsorship() public {103 require(false, stub_error);104 dummy = 0;105 }106107 /// Remove collection sponsor.108 /// @dev EVM selector for this function is: 0x6e0326a3,109 /// or in textual repr: removeCollectionSponsor()110 function removeCollectionSponsor() public {111 require(false, stub_error);112 dummy = 0;113 }114115 /// Get current sponsor.116 ///117 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.118 /// @dev EVM selector for this function is: 0x6ec0a9f1,119 /// or in textual repr: collectionSponsor()120 function collectionSponsor() public view returns (Tuple6 memory) {121 require(false, stub_error);122 dummy;123 return Tuple6(0x0000000000000000000000000000000000000000, 0);124 }125126 /// Set limits for the collection.127 /// @dev Throws error if limit not found.128 /// @param limit Name of the limit. Valid names:129 /// "accountTokenOwnershipLimit",130 /// "sponsoredDataSize",131 /// "sponsoredDataRateLimit",132 /// "tokenLimit",133 /// "sponsorTransferTimeout",134 /// "sponsorApproveTimeout"135 /// @param value Value of the limit.136 /// @dev EVM selector for this function is: 0x6a3841db,137 /// or in textual repr: setCollectionLimit(string,uint32)138 function setCollectionLimit(string memory limit, uint32 value) public {139 require(false, stub_error);140 limit;141 value;142 dummy = 0;143 }144145 /// Set limits for the collection.146 /// @dev Throws error if limit not found.147 /// @param limit Name of the limit. Valid names:148 /// "ownerCanTransfer",149 /// "ownerCanDestroy",150 /// "transfersEnabled"151 /// @param value Value of the limit.152 /// @dev EVM selector for this function is: 0x993b7fba,153 /// or in textual repr: setCollectionLimit(string,bool)154 function setCollectionLimit(string memory limit, bool value) public {155 require(false, stub_error);156 limit;157 value;158 dummy = 0;159 }160161 /// Get contract address.162 /// @dev EVM selector for this function is: 0xf6b4dfb4,163 /// or in textual repr: contractAddress()164 function contractAddress() public view returns (address) {165 require(false, stub_error);166 dummy;167 return 0x0000000000000000000000000000000000000000;168 }169170 /// Add collection admin by substrate address.171 /// @param newAdmin Substrate administrator address.172 /// @dev EVM selector for this function is: 0x5730062b,173 /// or in textual repr: addCollectionAdminSubstrate(uint256)174 function addCollectionAdminSubstrate(uint256 newAdmin) public {175 require(false, stub_error);176 newAdmin;177 dummy = 0;178 }179180 /// Remove collection admin by substrate address.181 /// @param admin Substrate administrator address.182 /// @dev EVM selector for this function is: 0x4048fcf9,183 /// or in textual repr: removeCollectionAdminSubstrate(uint256)184 function removeCollectionAdminSubstrate(uint256 admin) public {185 require(false, stub_error);186 admin;187 dummy = 0;188 }189190 /// Add collection admin.191 /// @param newAdmin Address of the added administrator.192 /// @dev EVM selector for this function is: 0x92e462c7,193 /// or in textual repr: addCollectionAdmin(address)194 function addCollectionAdmin(address newAdmin) public {195 require(false, stub_error);196 newAdmin;197 dummy = 0;198 }199200 /// Remove collection admin.201 ///202 /// @param admin Address of the removed administrator.203 /// @dev EVM selector for this function is: 0xfafd7b42,204 /// or in textual repr: removeCollectionAdmin(address)205 function removeCollectionAdmin(address admin) public {206 require(false, stub_error);207 admin;208 dummy = 0;209 }210211 /// Toggle accessibility of collection nesting.212 ///213 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'214 /// @dev EVM selector for this function is: 0x112d4586,215 /// or in textual repr: setCollectionNesting(bool)216 function setCollectionNesting(bool enable) public {217 require(false, stub_error);218 enable;219 dummy = 0;220 }221222 /// Toggle accessibility of collection nesting.223 ///224 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'225 /// @param collections Addresses of collections that will be available for nesting.226 /// @dev EVM selector for this function is: 0x64872396,227 /// or in textual repr: setCollectionNesting(bool,address[])228 function setCollectionNesting(bool enable, address[] memory collections) public {229 require(false, stub_error);230 enable;231 collections;232 dummy = 0;233 }234235 /// Set the collection access method.236 /// @param mode Access mode237 /// 0 for Normal238 /// 1 for AllowList239 /// @dev EVM selector for this function is: 0x41835d4c,240 /// or in textual repr: setCollectionAccess(uint8)241 function setCollectionAccess(uint8 mode) public {242 require(false, stub_error);243 mode;244 dummy = 0;245 }246247 /// Checks that user allowed to operate with collection.248 ///249 /// @param user User address to check.250 /// @dev EVM selector for this function is: 0xd63a8e11,251 /// or in textual repr: allowed(address)252 function allowed(address user) public view returns (bool) {253 require(false, stub_error);254 user;255 dummy;256 return false;257 }258259 /// Add the user to the allowed list.260 ///261 /// @param user Address of a trusted user.262 /// @dev EVM selector for this function is: 0x67844fe6,263 /// or in textual repr: addToCollectionAllowList(address)264 function addToCollectionAllowList(address user) public {265 require(false, stub_error);266 user;267 dummy = 0;268 }269270 /// Add substrate user to allowed list.271 ///272 /// @param user User substrate address.273 /// @dev EVM selector for this function is: 0xd06ad267,274 /// or in textual repr: addToCollectionAllowListSubstrate(uint256)275 function addToCollectionAllowListSubstrate(uint256 user) public {276 require(false, stub_error);277 user;278 dummy = 0;279 }280281 /// Remove the user from the allowed list.282 ///283 /// @param user Address of a removed user.284 /// @dev EVM selector for this function is: 0x85c51acb,285 /// or in textual repr: removeFromCollectionAllowList(address)286 function removeFromCollectionAllowList(address user) public {287 require(false, stub_error);288 user;289 dummy = 0;290 }291292 /// Remove substrate user from allowed list.293 ///294 /// @param user User substrate address.295 /// @dev EVM selector for this function is: 0xa31913ed,296 /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256)297 function removeFromCollectionAllowListSubstrate(uint256 user) public {298 require(false, stub_error);299 user;300 dummy = 0;301 }302303 /// Switch permission for minting.304 ///305 /// @param mode Enable if "true".306 /// @dev EVM selector for this function is: 0x00018e84,307 /// or in textual repr: setCollectionMintMode(bool)308 function setCollectionMintMode(bool mode) public {309 require(false, stub_error);310 mode;311 dummy = 0;312 }313314 /// Check that account is the owner or admin of the collection315 ///316 /// @param user account to verify317 /// @return "true" if account is the owner or admin318 /// @dev EVM selector for this function is: 0x9811b0c7,319 /// or in textual repr: isOwnerOrAdmin(address)320 function isOwnerOrAdmin(address user) public view returns (bool) {321 require(false, stub_error);322 user;323 dummy;324 return false;325 }326327 /// Check that substrate account is the owner or admin of the collection328 ///329 /// @param user account to verify330 /// @return "true" if account is the owner or admin331 /// @dev EVM selector for this function is: 0x68910e00,332 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)333 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {334 require(false, stub_error);335 user;336 dummy;337 return false;338 }339340 /// Returns collection type341 ///342 /// @return `Fungible` or `NFT` or `ReFungible`343 /// @dev EVM selector for this function is: 0xd34b55b8,344 /// or in textual repr: uniqueCollectionType()345 function uniqueCollectionType() public view returns (string memory) {346 require(false, stub_error);347 dummy;348 return "";349 }350351 /// Get collection owner.352 ///353 /// @return Tuble with sponsor address and his substrate mirror.354 /// If address is canonical then substrate mirror is zero and vice versa.355 /// @dev EVM selector for this function is: 0xdf727d3b,356 /// or in textual repr: collectionOwner()357 function collectionOwner() public view returns (Tuple6 memory) {358 require(false, stub_error);359 dummy;360 return Tuple6(0x0000000000000000000000000000000000000000, 0);361 }362363 /// Changes collection owner to another account364 ///365 /// @dev Owner can be changed only by current owner366 /// @param newOwner new owner account367 /// @dev EVM selector for this function is: 0x13af4035,368 /// or in textual repr: setOwner(address)369 function setOwner(address newOwner) public {370 require(false, stub_error);371 newOwner;372 dummy = 0;373 }374375 /// Changes collection owner to another substrate account376 ///377 /// @dev Owner can be changed only by current owner378 /// @param newOwner new owner substrate account379 /// @dev EVM selector for this function is: 0xb212138f,380 /// or in textual repr: setOwnerSubstrate(uint256)381 function setOwnerSubstrate(uint256 newOwner) public {382 require(false, stub_error);383 newOwner;384 dummy = 0;385 }386}387388/// @dev the ERC-165 identifier for this interface is 0x63034ac5389contract ERC20UniqueExtensions is Dummy, ERC165 {390 /// Burn tokens from account391 /// @dev Function that burns an `amount` of the tokens of a given account,392 /// deducting from the sender's allowance for said account.393 /// @param from The account whose tokens will be burnt.394 /// @param amount The amount that will be burnt.395 /// @dev EVM selector for this function is: 0x79cc6790,396 /// or in textual repr: burnFrom(address,uint256)397 function burnFrom(address from, uint256 amount) public returns (bool) {398 require(false, stub_error);399 from;400 amount;401 dummy = 0;402 return false;403 }404405 /// Mint tokens for multiple accounts.406 /// @param amounts array of pairs of account address and amount407 /// @dev EVM selector for this function is: 0x1acf2d55,408 /// or in textual repr: mintBulk((address,uint256)[])409 function mintBulk(Tuple6[] memory amounts) public returns (bool) {410 require(false, stub_error);411 amounts;412 dummy = 0;413 return false;414 }415}416417/// @dev anonymous struct418struct Tuple6 {419 address field_0;420 uint256 field_1;421}422423/// @dev the ERC-165 identifier for this interface is 0x40c10f19424contract ERC20Mintable is Dummy, ERC165 {425 /// Mint tokens for `to` account.426 /// @param to account that will receive minted tokens427 /// @param amount amount of tokens to mint428 /// @dev EVM selector for this function is: 0x40c10f19,429 /// or in textual repr: mint(address,uint256)430 function mint(address to, uint256 amount) public returns (bool) {431 require(false, stub_error);432 to;433 amount;434 dummy = 0;435 return false;436 }437}438439/// @dev inlined interface440contract ERC20Events {441 event Transfer(address indexed from, address indexed to, uint256 value);442 event Approval(address indexed owner, address indexed spender, uint256 value);443}444445/// @dev the ERC-165 identifier for this interface is 0x942e8b22446contract ERC20 is Dummy, ERC165, ERC20Events {447 /// @dev EVM selector for this function is: 0x06fdde03,448 /// or in textual repr: name()449 function name() public view returns (string memory) {450 require(false, stub_error);451 dummy;452 return "";453 }454455 /// @dev EVM selector for this function is: 0x95d89b41,456 /// or in textual repr: symbol()457 function symbol() public view returns (string memory) {458 require(false, stub_error);459 dummy;460 return "";461 }462463 /// @dev EVM selector for this function is: 0x18160ddd,464 /// or in textual repr: totalSupply()465 function totalSupply() public view returns (uint256) {466 require(false, stub_error);467 dummy;468 return 0;469 }470471 /// @dev EVM selector for this function is: 0x313ce567,472 /// or in textual repr: decimals()473 function decimals() public view returns (uint8) {474 require(false, stub_error);475 dummy;476 return 0;477 }478479 /// @dev EVM selector for this function is: 0x70a08231,480 /// or in textual repr: balanceOf(address)481 function balanceOf(address owner) public view returns (uint256) {482 require(false, stub_error);483 owner;484 dummy;485 return 0;486 }487488 /// @dev EVM selector for this function is: 0xa9059cbb,489 /// or in textual repr: transfer(address,uint256)490 function transfer(address to, uint256 amount) public returns (bool) {491 require(false, stub_error);492 to;493 amount;494 dummy = 0;495 return false;496 }497498 /// @dev EVM selector for this function is: 0x23b872dd,499 /// or in textual repr: transferFrom(address,address,uint256)500 function transferFrom(501 address from,502 address to,503 uint256 amount504 ) public returns (bool) {505 require(false, stub_error);506 from;507 to;508 amount;509 dummy = 0;510 return false;511 }512513 /// @dev EVM selector for this function is: 0x095ea7b3,514 /// or in textual repr: approve(address,uint256)515 function approve(address spender, uint256 amount) public returns (bool) {516 require(false, stub_error);517 spender;518 amount;519 dummy = 0;520 return false;521 }522523 /// @dev EVM selector for this function is: 0xdd62ed3e,524 /// or in textual repr: allowance(address,address)525 function allowance(address owner, address spender) public view returns (uint256) {526 require(false, stub_error);527 owner;528 spender;529 dummy;530 return 0;531 }532}533534contract UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -85,11 +81,7 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- public
- view
- returns (bytes memory)
- {
+ function property(uint256 tokenId, string memory key) public view returns (bytes memory) {
require(false, stub_error);
tokenId;
key;
@@ -99,7 +91,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -107,9 +99,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -135,11 +125,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -172,6 +158,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -201,9 +188,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple17 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple17 memory) {
require(false, stub_error);
dummy;
return Tuple17(0x0000000000000000000000000000000000000000, 0);
@@ -311,9 +298,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -430,9 +415,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -605,10 +590,7 @@
/// @param tokenIds IDs of the minted NFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- public
- returns (bool)
- {
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
require(false, stub_error);
to;
tokenIds;
@@ -623,10 +605,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- public
- returns (bool)
- {
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {
require(false, stub_error);
to;
tokens;
@@ -661,11 +640,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- public
- view
- returns (uint256)
- {
+ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(false, stub_error);
owner;
index;
@@ -728,21 +703,9 @@
/// @dev inlined interface
contract ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -870,11 +833,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- public
- view
- returns (address)
- {
+ function isApprovedForAll(address owner, address operator) public view returns (address) {
require(false, stub_error);
owner;
operator;
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -85,11 +81,7 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- public
- view
- returns (bytes memory)
- {
+ function property(uint256 tokenId, string memory key) public view returns (bytes memory) {
require(false, stub_error);
tokenId;
key;
@@ -99,7 +91,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -107,9 +99,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -135,11 +125,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -172,6 +158,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -201,9 +188,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple17 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple17 memory) {
require(false, stub_error);
dummy;
return Tuple17(0x0000000000000000000000000000000000000000, 0);
@@ -311,9 +298,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -430,9 +415,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -607,10 +592,7 @@
/// @param tokenIds IDs of the minted RFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- public
- returns (bool)
- {
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
require(false, stub_error);
to;
tokenIds;
@@ -625,10 +607,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- public
- returns (bool)
- {
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {
require(false, stub_error);
to;
tokens;
@@ -675,11 +654,7 @@
/// Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- public
- view
- returns (uint256)
- {
+ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(false, stub_error);
owner;
index;
@@ -740,21 +715,9 @@
/// @dev inlined interface
contract ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -880,11 +843,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- public
- view
- returns (address)
- {
+ function isApprovedForAll(address owner, address operator) public view returns (address) {
require(false, stub_error);
owner;
operator;
pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -72,11 +68,7 @@
/// @dev inlined interface
contract ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @title Standard ERC20 token
@@ -188,11 +180,7 @@
/// @return A uint256 specifying the amount of tokens still available for the spender.
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- public
- view
- returns (uint256)
- {
+ function allowance(address owner, address spender) public view returns (uint256) {
require(false, stub_error);
owner;
spender;
@@ -201,10 +189,4 @@
}
}
-contract UniqueRefungibleToken is
- Dummy,
- ERC165,
- ERC20,
- ERC20UniqueExtensions,
- ERC1633
-{}
+contract UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {}
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -15,15 +15,12 @@
/// @dev inlined interface
interface ContractHelpersEvents {
event ContractSponsorSet(address indexed contractAddress, address sponsor);
- event ContractSponsorshipConfirmed(
- address indexed contractAddress,
- address sponsor
- );
+ event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);
event ContractSponsorRemoved(address indexed contractAddress);
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -34,10 +31,7 @@
/// @return address Owner of contract
/// @dev EVM selector for this function is: 0x5152b14c,
/// or in textual repr: contractOwner(address)
- function contractOwner(address contractAddress)
- external
- view
- returns (address);
+ function contractOwner(address contractAddress) external view returns (address);
/// Set sponsor.
/// @param contractAddress Contract for which a sponsor is being established.
@@ -73,12 +67,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress)
- external
- view
- returns (Tuple0 memory);
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) external view returns (Tuple0 memory);
/// Check tat contract has confirmed sponsor.
///
@@ -94,17 +85,11 @@
/// @return **true** if contract has pending sponsor.
/// @dev EVM selector for this function is: 0x39b9b242,
/// or in textual repr: hasPendingSponsor(address)
- function hasPendingSponsor(address contractAddress)
- external
- view
- returns (bool);
+ function hasPendingSponsor(address contractAddress) external view returns (bool);
/// @dev EVM selector for this function is: 0x6027dc61,
/// or in textual repr: sponsoringEnabled(address)
- function sponsoringEnabled(address contractAddress)
- external
- view
- returns (bool);
+ function sponsoringEnabled(address contractAddress) external view returns (bool);
/// @dev EVM selector for this function is: 0xfde8a560,
/// or in textual repr: setSponsoringMode(address,uint8)
@@ -113,12 +98,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress)
- external
- view
- returns (uint32);
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) external view returns (uint32);
/// Set contract sponsoring rate limit
/// @dev Sponsoring rate limit - is a minimum amount of blocks that should
@@ -128,8 +110,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x77b6c908,
/// or in textual repr: setSponsoringRateLimit(address,uint32)
- function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
- external;
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external;
/// Set contract sponsoring fee limit
/// @dev Sponsoring fee limit - is maximum fee that could be spent by
@@ -139,19 +120,15 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x03aed665,
/// or in textual repr: setSponsoringFeeLimit(address,uint256)
- function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
- external;
+ function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external;
/// Get current contract sponsoring fee limit
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress)
- external
- view
- returns (uint256);
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) external view returns (uint256);
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
@@ -160,10 +137,7 @@
/// @return bool Is specified users exists in contract allowlist
/// @dev EVM selector for this function is: 0x5c658165,
/// or in textual repr: allowed(address,address)
- function allowed(address contractAddress, address user)
- external
- view
- returns (bool);
+ function allowed(address contractAddress, address user) external view returns (bool);
/// Toggle user presence in contract allowlist
/// @param contractAddress Contract to change allowlist of
@@ -187,10 +161,7 @@
/// @return bool Is specified contract has allowlist access enabled
/// @dev EVM selector for this function is: 0xc772ef6c,
/// or in textual repr: allowlistEnabled(address)
- function allowlistEnabled(address contractAddress)
- external
- view
- returns (bool);
+ function allowlistEnabled(address contractAddress) external view returns (bool);
/// Toggle contract allowlist access
/// @param contractAddress Contract to change allowlist access of
tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -13,7 +13,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -21,8 +21,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -39,10 +38,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -62,6 +58,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -81,9 +78,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple6 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple6 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -153,8 +150,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -227,7 +223,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -291,11 +287,7 @@
/// @dev inlined interface
interface ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @dev the ERC-165 identifier for this interface is 0x942e8b22
@@ -338,17 +330,7 @@
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- external
- view
- returns (uint256);
+ function allowance(address owner, address spender) external view returns (uint256);
}
-interface UniqueFungible is
- Dummy,
- ERC165,
- ERC20,
- ERC20Mintable,
- ERC20UniqueExtensions,
- Collection
-{}
+interface UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -58,14 +58,11 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- external
- view
- returns (bytes memory);
+ function property(uint256 tokenId, string memory key) external view returns (bytes memory);
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -73,8 +70,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -91,10 +87,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -114,6 +107,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -133,9 +127,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple17 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple17 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -205,8 +199,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -279,7 +272,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -399,9 +392,7 @@
/// @param tokenIds IDs of the minted NFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- external
- returns (bool);
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
@@ -410,9 +401,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- external
- returns (bool);
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);
}
/// @dev anonymous struct
@@ -436,10 +425,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- external
- view
- returns (uint256);
+ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/// @notice Count NFTs tracked by this contract
/// @return A count of valid NFTs tracked by this contract, where each one of
@@ -479,21 +465,9 @@
/// @dev inlined interface
interface ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -577,10 +551,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- external
- view
- returns (address);
+ function isApprovedForAll(address owner, address operator) external view returns (address);
}
interface UniqueNFT is
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -58,14 +58,11 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- external
- view
- returns (bytes memory);
+ function property(uint256 tokenId, string memory key) external view returns (bytes memory);
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -73,8 +70,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -91,10 +87,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -114,6 +107,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -133,9 +127,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple17 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple17 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -205,8 +199,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -279,7 +272,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -401,9 +394,7 @@
/// @param tokenIds IDs of the minted RFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- external
- returns (bool);
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
@@ -412,19 +403,14 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- external
- returns (bool);
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);
/// Returns EVM address for refungible token
///
/// @param token ID of the token
/// @dev EVM selector for this function is: 0xab76fac6,
/// or in textual repr: tokenContractAddress(uint256)
- function tokenContractAddress(uint256 token)
- external
- view
- returns (address);
+ function tokenContractAddress(uint256 token) external view returns (address);
}
/// @dev anonymous struct
@@ -448,10 +434,7 @@
/// Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- external
- view
- returns (uint256);
+ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/// @notice Count RFTs tracked by this contract
/// @return A count of valid RFTs tracked by this contract, where each one of
@@ -489,21 +472,9 @@
/// @dev inlined interface
interface ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -585,10 +556,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- external
- view
- returns (address);
+ function isApprovedForAll(address owner, address operator) external view returns (address);
}
interface UniqueRefungible is
tests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungibleToken.sol
+++ b/tests/src/eth/api/UniqueRefungibleToken.sol
@@ -44,11 +44,7 @@
/// @dev inlined interface
interface ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @title Standard ERC20 token
@@ -120,16 +116,7 @@
/// @return A uint256 specifying the amount of tokens still available for the spender.
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- external
- view
- returns (uint256);
+ function allowance(address owner, address spender) external view returns (uint256);
}
-interface UniqueRefungibleToken is
- Dummy,
- ERC165,
- ERC20,
- ERC20UniqueExtensions,
- ERC1633
-{}
+interface UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {}
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -56,7 +56,7 @@
await submitTransactionAsync(sponsor, confirmTx);
expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
- const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner});
+ const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address);
});
@@ -77,7 +77,7 @@
await collectionEvm.methods.removeCollectionSponsor().send({from: owner});
- const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner});
+ const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');
});
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -223,7 +223,7 @@
const helpers = contractHelpers(web3, owner);
await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(flipper.options.address);
expect(result[1]).to.be.eq('0');
@@ -237,7 +237,7 @@
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(sponsor);
expect(result[1]).to.be.eq('0');
@@ -482,7 +482,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
+ expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
});
});
@@ -551,7 +551,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
});
itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
@@ -559,7 +559,7 @@
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
});
itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
tests/src/eth/fungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/fungibleAbi.json
+++ b/tests/src/eth/fungibleAbi.json
@@ -159,6 +159,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple6",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -183,23 +200,6 @@
"name": "deleteCollectionProperty",
"outputs": [],
"stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple6",
- "name": "",
- "type": "tuple"
- }
- ],
- "stateMutability": "view",
"type": "function"
},
{
@@ -453,7 +453,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -189,6 +189,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple17",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -231,23 +248,6 @@
],
"name": "getApproved",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple17",
- "name": "",
- "type": "tuple"
- }
- ],
"stateMutability": "view",
"type": "function"
},
@@ -651,7 +651,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/reFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/reFungibleAbi.json
+++ b/tests/src/eth/reFungibleAbi.json
@@ -189,6 +189,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple17",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -231,23 +248,6 @@
],
"name": "getApproved",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple17",
- "name": "",
- "type": "tuple"
- }
- ],
"stateMutability": "view",
"type": "function"
},
@@ -660,7 +660,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -111,18 +111,8 @@
"type": "address"
}
],
- "name": "getSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple0",
- "name": "",
- "type": "tuple"
- }
- ],
+ "name": "hasPendingSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -134,8 +124,8 @@
"type": "address"
}
],
- "name": "getSponsoringFeeLimit",
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "name": "hasSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -147,9 +137,9 @@
"type": "address"
}
],
- "name": "getSponsoringRateLimit",
- "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
- "stateMutability": "view",
+ "name": "removeSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -160,9 +150,9 @@
"type": "address"
}
],
- "name": "hasPendingSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "selfSponsoredEnable",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -171,11 +161,12 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "address", "name": "sponsor", "type": "address" }
],
- "name": "hasSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "setSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -184,9 +175,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
],
- "name": "removeSponsor",
+ "name": "setSponsoringFeeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -197,9 +189,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint8", "name": "mode", "type": "uint8" }
],
- "name": "selfSponsoredEnable",
+ "name": "setSponsoringMode",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -211,9 +204,9 @@
"name": "contractAddress",
"type": "address"
},
- { "internalType": "address", "name": "sponsor", "type": "address" }
+ { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
],
- "name": "setSponsor",
+ "name": "setSponsoringRateLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -224,12 +217,21 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
+ }
+ ],
+ "name": "sponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple0",
+ "name": "",
+ "type": "tuple"
+ }
],
- "name": "setSponsoringFeeLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
},
{
@@ -238,12 +240,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint8", "name": "mode", "type": "uint8" }
+ }
],
- "name": "setSponsoringMode",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringEnabled",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -252,12 +253,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
+ }
],
- "name": "setSponsoringRateLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringFeeLimit",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -268,8 +268,8 @@
"type": "address"
}
],
- "name": "sponsoringEnabled",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "name": "sponsoringRateLimit",
+ "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
"stateMutability": "view",
"type": "function"
},