Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardhat: Changed Events in contracts #62

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/fusionseries/FusionSeries.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ contract FusionSeries is Context, ERC1155Supply {
_;
}

event AssetCreated(
event FusionSeriesAssetCreated(
uint256 indexed tokenID,
address indexed creator,
uint256 indexed amount
);
event AssetDestroyed(uint indexed tokenId, address ownerOrApproved);
event FusionSeriesAssetDestroyed(uint indexed tokenId, address ownerOrApproved);

// tradeHub should be there
/**
Expand Down Expand Up @@ -103,7 +103,7 @@ contract FusionSeries is Context, ERC1155Supply {
_mint(_msgSender(), currentTokenID, amount, data);
_tokenURIs[currentTokenID] = _uri;
setApprovalForAll(tradeHub, true);
emit AssetCreated(currentTokenID, _msgSender(), amount);
emit FusionSeriesAssetCreated(currentTokenID, _msgSender(), amount);
return currentTokenID;
}

Expand All @@ -129,7 +129,7 @@ contract FusionSeries is Context, ERC1155Supply {
_mint(creator, currentTokenID, amount, data);
_tokenURIs[currentTokenID] = _uri;
setApprovalForAll(tradeHub, true);
emit AssetCreated(currentTokenID, _msgSender(), amount);
emit FusionSeriesAssetCreated(currentTokenID, _msgSender(), amount);
return currentTokenID;
}

Expand All @@ -146,7 +146,7 @@ contract FusionSeries is Context, ERC1155Supply {
"FusionSeries: Caller is not token owner or approved"
);
_burn(_msgSender(), tokenId, amount);
emit AssetDestroyed(tokenId, _msgSender());
emit FusionSeriesAssetDestroyed(tokenId, _msgSender());
}

/// @dev ONLY Operator can set the Base URI
Expand Down
8 changes: 4 additions & 4 deletions contracts/instagen/InstaGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ contract InstaGen is IERC4907, Context, ERC2981, ERC721A, ERC721ABurnable {
_;
}

event AssetCreated(
event InstaGenAssetCreated(
uint256 currentIndex,
uint256 quantity,
address indexed creator
);
event AssetDestroyed(uint indexed tokenId, address ownerOrApproved);
event InstaGenAssetDestroyed(uint indexed tokenId, address ownerOrApproved);

event RentalInfo(
uint256 tokenId,
Expand Down Expand Up @@ -122,7 +122,7 @@ contract InstaGen is IERC4907, Context, ERC2981, ERC721A, ERC721ABurnable {
}
_safeMint(_msgSender(), quantity);
setApprovalForAll(tradeHub, true);
emit AssetCreated(_totalMinted(), quantity, _msgSender());
emit InstaGenAssetCreated(_totalMinted(), quantity, _msgSender());
return (prevQuantity, quantity);
}

Expand All @@ -142,7 +142,7 @@ contract InstaGen is IERC4907, Context, ERC2981, ERC721A, ERC721ABurnable {
);
_burn(tokenId, true);
_resetTokenRoyalty(tokenId);
emit AssetDestroyed(tokenId, _msgSender());
emit InstaGenAssetDestroyed(tokenId, _msgSender());
}

function withdraw() external onlyAdmin {
Expand Down
10 changes: 5 additions & 5 deletions contracts/signatureseries/SignatureSeries.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ contract SignatureSeries is Context, ERC721Enumerable, ERC2981, IERC4907 {
_;
}

event AssetCreated(
event SignatureSeriesAssetCreated(
uint256 tokenID,
address indexed creator,
string metaDataURI
);
event AssetDestroyed(uint indexed tokenId, address ownerOrApproved);
event SignatureSeriesAssetDestroyed(uint indexed tokenId, address ownerOrApproved);
event RentalInfo(
uint256 tokenId,
bool isRentable,
Expand Down Expand Up @@ -137,7 +137,7 @@ contract SignatureSeries is Context, ERC721Enumerable, ERC2981, IERC4907 {
// Approve tradeHub to transfer NFTs
setApprovalForAll(tradeHub, true);

emit AssetCreated(currentTokenID, _msgSender(), metadataURI);
emit SignatureSeriesAssetCreated(currentTokenID, _msgSender(), metadataURI);
return currentTokenID;
}

Expand Down Expand Up @@ -174,7 +174,7 @@ contract SignatureSeries is Context, ERC721Enumerable, ERC2981, IERC4907 {
// Approve tradeHub to transfer NFTs
setApprovalForAll(tradeHub, true);

emit AssetCreated(currentTokenID, creator, metadataURI);
emit SignatureSeriesAssetCreated(currentTokenID, creator, metadataURI);
return currentTokenID;
}

Expand All @@ -191,7 +191,7 @@ contract SignatureSeries is Context, ERC721Enumerable, ERC2981, IERC4907 {
"SignatureSeries: Caller is not token owner or approved"
);
_burn(tokenId);
emit AssetDestroyed(tokenId, _msgSender());
emit SignatureSeriesAssetDestroyed(tokenId, _msgSender());
_resetTokenRoyalty(tokenId);
}

Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = {
maticmum: {
networkId: 80001,
url: MATICMUM_RPC_URL,
// accounts: [`0x${ETH_PRIVATE_KEY}`],
// accounts: [PRIVATE_KEY],
accounts: {
mnemonic: MNEMONIC,
},
Expand Down
5 changes: 4 additions & 1 deletion scripts/launch/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"contractName" : "AccessMaster",
"contractName" : "TradeHub",
"constructorParams":{
"param1": 30,
"param2" : "NFT BAZAAR",
"param3" : "0x7d03a6da1D3E6B63Cd08f51B64907Fa0161A53e8"
}
}
34 changes: 18 additions & 16 deletions typechain-types/FusionSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,16 @@ export interface FusionSeriesInterface extends utils.Interface {

events: {
"ApprovalForAll(address,address,bool)": EventFragment;
"AssetCreated(uint256,address,uint256)": EventFragment;
"AssetDestroyed(uint256,address)": EventFragment;
"FusionSeriesAssetCreated(uint256,address,uint256)": EventFragment;
"FusionSeriesAssetDestroyed(uint256,address)": EventFragment;
"TransferBatch(address,address,address,uint256[],uint256[])": EventFragment;
"TransferSingle(address,address,address,uint256,uint256)": EventFragment;
"URI(string,uint256)": EventFragment;
};

getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment;
getEvent(nameOrSignatureOrTopic: "AssetCreated"): EventFragment;
getEvent(nameOrSignatureOrTopic: "AssetDestroyed"): EventFragment;
getEvent(nameOrSignatureOrTopic: "FusionSeriesAssetCreated"): EventFragment;
getEvent(nameOrSignatureOrTopic: "FusionSeriesAssetDestroyed"): EventFragment;
getEvent(nameOrSignatureOrTopic: "TransferBatch"): EventFragment;
getEvent(nameOrSignatureOrTopic: "TransferSingle"): EventFragment;
getEvent(nameOrSignatureOrTopic: "URI"): EventFragment;
Expand All @@ -168,19 +168,21 @@ export type ApprovalForAllEvent = TypedEvent<

export type ApprovalForAllEventFilter = TypedEventFilter<ApprovalForAllEvent>;

export type AssetCreatedEvent = TypedEvent<
export type FusionSeriesAssetCreatedEvent = TypedEvent<
[BigNumber, string, BigNumber],
{ tokenID: BigNumber; creator: string; amount: BigNumber }
>;

export type AssetCreatedEventFilter = TypedEventFilter<AssetCreatedEvent>;
export type FusionSeriesAssetCreatedEventFilter =
TypedEventFilter<FusionSeriesAssetCreatedEvent>;

export type AssetDestroyedEvent = TypedEvent<
export type FusionSeriesAssetDestroyedEvent = TypedEvent<
[BigNumber, string],
{ tokenId: BigNumber; ownerOrApproved: string }
>;

export type AssetDestroyedEventFilter = TypedEventFilter<AssetDestroyedEvent>;
export type FusionSeriesAssetDestroyedEventFilter =
TypedEventFilter<FusionSeriesAssetDestroyedEvent>;

export type TransferBatchEvent = TypedEvent<
[string, string, string, BigNumber[], BigNumber[]],
Expand Down Expand Up @@ -522,25 +524,25 @@ export interface FusionSeries extends BaseContract {
approved?: null
): ApprovalForAllEventFilter;

"AssetCreated(uint256,address,uint256)"(
"FusionSeriesAssetCreated(uint256,address,uint256)"(
tokenID?: BigNumberish | null,
creator?: string | null,
amount?: BigNumberish | null
): AssetCreatedEventFilter;
AssetCreated(
): FusionSeriesAssetCreatedEventFilter;
FusionSeriesAssetCreated(
tokenID?: BigNumberish | null,
creator?: string | null,
amount?: BigNumberish | null
): AssetCreatedEventFilter;
): FusionSeriesAssetCreatedEventFilter;

"AssetDestroyed(uint256,address)"(
"FusionSeriesAssetDestroyed(uint256,address)"(
tokenId?: BigNumberish | null,
ownerOrApproved?: null
): AssetDestroyedEventFilter;
AssetDestroyed(
): FusionSeriesAssetDestroyedEventFilter;
FusionSeriesAssetDestroyed(
tokenId?: BigNumberish | null,
ownerOrApproved?: null
): AssetDestroyedEventFilter;
): FusionSeriesAssetDestroyedEventFilter;

"TransferBatch(address,address,address,uint256[],uint256[])"(
operator?: string | null,
Expand Down
74 changes: 38 additions & 36 deletions typechain-types/InstaGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,19 @@ export interface InstaGenInterface extends utils.Interface {
events: {
"Approval(address,address,uint256)": EventFragment;
"ApprovalForAll(address,address,bool)": EventFragment;
"AssetCreated(uint256,uint256,address)": EventFragment;
"AssetDestroyed(uint256,address)": EventFragment;
"ConsecutiveTransfer(uint256,uint256,address,address)": EventFragment;
"InstaGenAssetCreated(uint256,uint256,address)": EventFragment;
"InstaGenAssetDestroyed(uint256,address)": EventFragment;
"RentalInfo(uint256,bool,uint256,address)": EventFragment;
"Transfer(address,address,uint256)": EventFragment;
"UpdateUser(uint256,address,uint64)": EventFragment;
};

getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment;
getEvent(nameOrSignatureOrTopic: "AssetCreated"): EventFragment;
getEvent(nameOrSignatureOrTopic: "AssetDestroyed"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ConsecutiveTransfer"): EventFragment;
getEvent(nameOrSignatureOrTopic: "InstaGenAssetCreated"): EventFragment;
getEvent(nameOrSignatureOrTopic: "InstaGenAssetDestroyed"): EventFragment;
getEvent(nameOrSignatureOrTopic: "RentalInfo"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment;
getEvent(nameOrSignatureOrTopic: "UpdateUser"): EventFragment;
Expand All @@ -264,27 +264,29 @@ export type ApprovalForAllEvent = TypedEvent<

export type ApprovalForAllEventFilter = TypedEventFilter<ApprovalForAllEvent>;

export type AssetCreatedEvent = TypedEvent<
export type ConsecutiveTransferEvent = TypedEvent<
[BigNumber, BigNumber, string, string],
{ fromTokenId: BigNumber; toTokenId: BigNumber; from: string; to: string }
>;

export type ConsecutiveTransferEventFilter =
TypedEventFilter<ConsecutiveTransferEvent>;

export type InstaGenAssetCreatedEvent = TypedEvent<
[BigNumber, BigNumber, string],
{ currentIndex: BigNumber; quantity: BigNumber; creator: string }
>;

export type AssetCreatedEventFilter = TypedEventFilter<AssetCreatedEvent>;
export type InstaGenAssetCreatedEventFilter =
TypedEventFilter<InstaGenAssetCreatedEvent>;

export type AssetDestroyedEvent = TypedEvent<
export type InstaGenAssetDestroyedEvent = TypedEvent<
[BigNumber, string],
{ tokenId: BigNumber; ownerOrApproved: string }
>;

export type AssetDestroyedEventFilter = TypedEventFilter<AssetDestroyedEvent>;

export type ConsecutiveTransferEvent = TypedEvent<
[BigNumber, BigNumber, string, string],
{ fromTokenId: BigNumber; toTokenId: BigNumber; from: string; to: string }
>;

export type ConsecutiveTransferEventFilter =
TypedEventFilter<ConsecutiveTransferEvent>;
export type InstaGenAssetDestroyedEventFilter =
TypedEventFilter<InstaGenAssetDestroyedEvent>;

export type RentalInfoEvent = TypedEvent<
[BigNumber, boolean, BigNumber, string],
Expand Down Expand Up @@ -806,26 +808,6 @@ export interface InstaGen extends BaseContract {
approved?: null
): ApprovalForAllEventFilter;

"AssetCreated(uint256,uint256,address)"(
currentIndex?: null,
quantity?: null,
creator?: string | null
): AssetCreatedEventFilter;
AssetCreated(
currentIndex?: null,
quantity?: null,
creator?: string | null
): AssetCreatedEventFilter;

"AssetDestroyed(uint256,address)"(
tokenId?: BigNumberish | null,
ownerOrApproved?: null
): AssetDestroyedEventFilter;
AssetDestroyed(
tokenId?: BigNumberish | null,
ownerOrApproved?: null
): AssetDestroyedEventFilter;

"ConsecutiveTransfer(uint256,uint256,address,address)"(
fromTokenId?: BigNumberish | null,
toTokenId?: null,
Expand All @@ -839,6 +821,26 @@ export interface InstaGen extends BaseContract {
to?: string | null
): ConsecutiveTransferEventFilter;

"InstaGenAssetCreated(uint256,uint256,address)"(
currentIndex?: null,
quantity?: null,
creator?: string | null
): InstaGenAssetCreatedEventFilter;
InstaGenAssetCreated(
currentIndex?: null,
quantity?: null,
creator?: string | null
): InstaGenAssetCreatedEventFilter;

"InstaGenAssetDestroyed(uint256,address)"(
tokenId?: BigNumberish | null,
ownerOrApproved?: null
): InstaGenAssetDestroyedEventFilter;
InstaGenAssetDestroyed(
tokenId?: BigNumberish | null,
ownerOrApproved?: null
): InstaGenAssetDestroyedEventFilter;

"RentalInfo(uint256,bool,uint256,address)"(
tokenId?: null,
isRentable?: null,
Expand Down
Loading