From 6ee27f6aeb6791b1ec959ef33544fcf96eec77bd Mon Sep 17 00:00:00 2001 From: Abdulla Al-Kamil Date: Fri, 6 Sep 2024 19:40:01 +0100 Subject: [PATCH] feat: script --- onchain/script/DemoBigEvent.s.sol | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/onchain/script/DemoBigEvent.s.sol b/onchain/script/DemoBigEvent.s.sol index ebb2caa..0fb5c46 100644 --- a/onchain/script/DemoBigEvent.s.sol +++ b/onchain/script/DemoBigEvent.s.sol @@ -27,25 +27,25 @@ contract RunBigEvent is Script { // Get lots of people to apply! uint256 i = 0; - for (; i < 50_000; i++) { + for (; i < 250_000; i++) { address[] memory noFriends = new address[](0); vm.prank(address(uint160(i))); eventRegistry.requestTicket(eventId, noFriends); } - for (; i < 100_000; i++) { + for (; i < 500_000; i++) { address[] memory oneFriend = new address[](1); vm.prank(address(uint160(i))); oneFriend[0] = address(uint160(i++)); eventRegistry.requestTicket(eventId, oneFriend); } - for (; i < 120_000; i++) { + for (; i < 750_000; i++) { address[] memory twoFriends = new address[](2); vm.prank(address(uint160(i))); twoFriends[0] = address(uint160(i++)); twoFriends[1] = address(uint160(i++)); eventRegistry.requestTicket(eventId, twoFriends); } - for (; i < 150_000; i++) { + for (; i < 1_000_000; i++) { address[] memory threeFriends = new address[](3); vm.prank(address(uint160(i))); threeFriends[0] = address(uint160(i++)); @@ -54,13 +54,17 @@ contract RunBigEvent is Script { eventRegistry.requestTicket(eventId, threeFriends); } + console.log("%s people have just applied for tickets", i); + // The ticket sale will be open now vm.warp(block.timestamp + 10 days); + console.log("Opening ticket sale window"); // Do the roll eventRegistry.issueTickets(eventId); - for (i = 0; i < 150_000; i++) { + // Go claim the tickets + for (i = 0; i < 1_000_000; i++) { vm.prank(address(uint160(i))); try eventRegistry.claimTickets(eventId) {} catch { @@ -70,6 +74,6 @@ contract RunBigEvent is Script { ITicket ticket = eventRegistry.getTicketContract(eventId); uint256 tokensIssued = uint256(vm.load(address(ticket), bytes32(uint256(6)))); - console.log(tokensIssued); + console.log("%s tickets have been issued", tokensIssued); } }