Skip to content

Commit

Permalink
feat: deploy lottery
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Sep 17, 2024
1 parent 96ccc6e commit 8ad6c6c
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[holesky]

MockUSD: [0xf0c14ce46ba2657a2982942f121f1484f2f03aec](https://holesky.etherscan.io/address/0xf0c14ce46ba2657a2982942f121f1484f2f03aec)

## [holesky]

MockUSD: [0xf0c14ce46ba2657a2982942f121f1484f2f03aec](https://holesky.etherscan.io/address/0xf0c14ce46ba2657a2982942f121f1484f2f03aec)

Lottery: [0xc83ffb298acac98195b485e4c566eab99814ab57](https://holesky.etherscan.io/address/0xc83ffb298acac98195b485e4c566eab99814ab57)

## Foundry

Expand Down
48 changes: 48 additions & 0 deletions broadcast/DeployLottery.s.sol/17000/run-1726617350.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"transactions": [
{
"hash": "0xaab77ec9469dbe1854846fead50c488dd4db2490672c4abfcf68da100686c977",
"transactionType": "CREATE",
"contractName": "Lottery",
"contractAddress": "0xc83ffb298acac98195b485e4c566eab99814ab57",
"function": null,
"arguments": [
"0xF0c14cE46bA2657A2982942F121F1484f2F03aEC"
],
"transaction": {
"from": "0x031c4f04b768bd76ac222cfd91385d848d91ffc7",
"gas": "0x1288a3",
"value": "0x0",
"input": "0x60806040526102586002556001600355600a600455683635c9adc5dea0000060055534801561002d57600080fd5b50604051610e0a380380610e0a83398101604081905261004c9161012f565b6001600081815581546001600160a01b0319166001600160a01b038416179091556006554260078190556002546100829161015f565b60085560006009819055600a81905560408051918252602082019081905290516100ae91600b916100b5565b5050610186565b82805482825590600052602060002090810192821561010a579160200282015b8281111561010a57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906100d5565b5061011692915061011a565b5090565b5b80821115610116576000815560010161011b565b60006020828403121561014157600080fd5b81516001600160a01b038116811461015857600080fd5b9392505050565b8082018082111561018057634e487b7160e01b600052601160045260246000fd5b92915050565b610c75806101956000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063a384d6ff11610066578063a384d6ff14610113578063b09ad8a01461011c578063d63a6ccd14610125578063f644b3bb14610150578063f7cb789a1461019757600080fd5b80636ffcc71914610098578063749aa2d9146100ad5780638a19c8bc146100b55780638e101867146100fc575b600080fd5b6100ab6100a6366004610ab6565b6101a0565b005b6100ab6106a0565b600654600754600854600954600a546100cf949392919085565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61010560055481565b6040519081526020016100f3565b61010560035481565b61010560045481565b600154610138906001600160a01b031681565b6040516001600160a01b0390911681526020016100f3565b61018261015e366004610ad8565b600c6020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016100f3565b61010560025481565b6101a8610725565b6006546000908152600c60209081526040808320338452909152902060010154156102295760405162461bcd60e51b815260206004820152602660248201527f4c6f74746572793a20796f7520616c72656164792062657420696e2074686973604482015265081c9bdd5b9960d21b60648201526084015b60405180910390fd5b600354821015801561023d57506004548211155b6102895760405162461bcd60e51b815260206004820152601d60248201527f4c6f74746572793a206e756d626572206f7574206f6620626f756e64730000006044820152606401610220565b600754421080159061029c575060085442105b6102e85760405162461bcd60e51b815260206004820152601e60248201527f4c6f74746572793a20726f756e64206e6f7420737461727465642079657400006044820152606401610220565b600081116103475760405162461bcd60e51b815260206004820152602660248201527f4c6f74746572793a20616d6f756e74206d75737420626520677265617465722060448201526507468616e20360d41b6064820152608401610220565b600154604051636eb1769f60e11b815233600482015230602482015282916001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b99190610b14565b10156104075760405162461bcd60e51b815260206004820152601f60248201527f4c6f74746572793a20696e73756666696369656e7420616c6c6f77616e6365006044820152606401610220565b6001546040516370a0823160e01b815233600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa15801561044f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104739190610b14565b10156104c15760405162461bcd60e51b815260206004820152601d60248201527f4c6f74746572793a20696e73756666696369656e742062616c616e63650000006044820152606401610220565b6005546009546104d2908390610b43565b111561052a5760405162461bcd60e51b815260206004820152602160248201527f4c6f74746572793a206d617820746f74616c20616d6f756e74207265616368656044820152601960fa1b6064820152608401610220565b6001546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a59190610b5c565b5060408051808201825283815260208082018481526006546000908152600c8352848120338252909252928120915182559151600190910155600980548392906105f0908490610b43565b9091555050600a805490600061060583610b85565b9091555050600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b03191633908117909155600654604080519182526020820185905281018390527f7363e6581df4db69463222156be4a09656528b9f1302890fa4c0b60819b69fc69060600160405180910390a261069c6001600055565b5050565b6106a8610725565b600854421015806106bd575060055460095410155b6107095760405162461bcd60e51b815260206004820152601c60248201527f4c6f74746572793a20726f756e64206e6f7420656e64656420796574000000006044820152606401610220565b61071161074f565b6107196109b0565b6107236001600055565b565b60026000540361074857604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b60006003546004544244600660050160405160200161077093929190610b9e565b6040516020818303038152906040528051906020012060001c6107939190610bf0565b61079d9190610b43565b60065460408051918252602082018390529192507f8868888cc18628a149bc88cc32a91976ab30e2cd9aececb0cfe184a73fe551f9910160405180910390a1600b5460005b818110156109ab576006546000908152600c60205260408120600b8054869391908590811061081357610813610c12565b60009182526020808320909101546001600160a01b03168352820192909252604001902054036109a3576006546000908152600c60205260408120600b80548391908590811061086557610865610c12565b60009182526020808320909101546001600160a01b03168352820192909252604001902060010154610898906002610c28565b600154600b80549293506001600160a01b039091169163a9059cbb9190859081106108c5576108c5610c12565b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af115801561091e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109429190610b5c565b50600b80548390811061095757610957610c12565b600091825260209182902001546040518381526001600160a01b03909116917f5d6c418cec2d4b92f1c8414ec09c6e3a58c94534413fdc0a906e85eb548a4f54910160405180910390a2505b6001016107e2565b505050565b600680549060006109c083610b85565b90915550504260078190556002546109d791610b43565b60085560006009819055600a8190556040805191825260208201908190529051610a0391600b91610a3c565b506006546040519081527fae4cf40c31a833f14b2aee71da8cb55d5fd1944a9ed5b7696022328921f6e3179060200160405180910390a1565b828054828255906000526020600020908101928215610a91579160200282015b82811115610a9157825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610a5c565b50610a9d929150610aa1565b5090565b5b80821115610a9d5760008155600101610aa2565b60008060408385031215610ac957600080fd5b50508035926020909101359150565b60008060408385031215610aeb57600080fd5b8235915060208301356001600160a01b0381168114610b0957600080fd5b809150509250929050565b600060208284031215610b2657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610b5657610b56610b2d565b92915050565b600060208284031215610b6e57600080fd5b81518015158114610b7e57600080fd5b9392505050565b600060018201610b9757610b97610b2d565b5060010190565b8381526000602084602084015260408301845485600052602060002060005b82811015610be25781546001600160a01b031684529284019260019182019101610bbd565b509198975050505050505050565b600082610c0d57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610b5657610b56610b2d56fea2646970667358221220b8c73a692a0d928662cda82d9328ca11ce36427fc42e310954c75afa675cd8e964736f6c63430008160033000000000000000000000000f0c14ce46ba2657a2982942f121f1484f2f03aec",
"nonce": "0x2",
"chainId": "0x4268"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x1a350d",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0xaab77ec9469dbe1854846fead50c488dd4db2490672c4abfcf68da100686c977",
"transactionIndex": "0x8",
"blockHash": "0x394a1aa701942fb99df63a8f63450b9502d9bb5ffef9af538d7edbc413c82803",
"blockNumber": "0x23f461",
"gasUsed": "0xe429d",
"effectiveGasPrice": "0x3b9aca00",
"from": "0x031c4f04b768bd76ac222cfd91385d848d91ffc7",
"to": null,
"contractAddress": "0xc83ffb298acac98195b485e4c566eab99814ab57"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1726617350,
"chain": 17000,
"commit": "459b498"
}
48 changes: 48 additions & 0 deletions broadcast/DeployLottery.s.sol/17000/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"transactions": [
{
"hash": "0xaab77ec9469dbe1854846fead50c488dd4db2490672c4abfcf68da100686c977",
"transactionType": "CREATE",
"contractName": "Lottery",
"contractAddress": "0xc83ffb298acac98195b485e4c566eab99814ab57",
"function": null,
"arguments": [
"0xF0c14cE46bA2657A2982942F121F1484f2F03aEC"
],
"transaction": {
"from": "0x031c4f04b768bd76ac222cfd91385d848d91ffc7",
"gas": "0x1288a3",
"value": "0x0",
"input": "0x60806040526102586002556001600355600a600455683635c9adc5dea0000060055534801561002d57600080fd5b50604051610e0a380380610e0a83398101604081905261004c9161012f565b6001600081815581546001600160a01b0319166001600160a01b038416179091556006554260078190556002546100829161015f565b60085560006009819055600a81905560408051918252602082019081905290516100ae91600b916100b5565b5050610186565b82805482825590600052602060002090810192821561010a579160200282015b8281111561010a57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906100d5565b5061011692915061011a565b5090565b5b80821115610116576000815560010161011b565b60006020828403121561014157600080fd5b81516001600160a01b038116811461015857600080fd5b9392505050565b8082018082111561018057634e487b7160e01b600052601160045260246000fd5b92915050565b610c75806101956000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063a384d6ff11610066578063a384d6ff14610113578063b09ad8a01461011c578063d63a6ccd14610125578063f644b3bb14610150578063f7cb789a1461019757600080fd5b80636ffcc71914610098578063749aa2d9146100ad5780638a19c8bc146100b55780638e101867146100fc575b600080fd5b6100ab6100a6366004610ab6565b6101a0565b005b6100ab6106a0565b600654600754600854600954600a546100cf949392919085565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61010560055481565b6040519081526020016100f3565b61010560035481565b61010560045481565b600154610138906001600160a01b031681565b6040516001600160a01b0390911681526020016100f3565b61018261015e366004610ad8565b600c6020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016100f3565b61010560025481565b6101a8610725565b6006546000908152600c60209081526040808320338452909152902060010154156102295760405162461bcd60e51b815260206004820152602660248201527f4c6f74746572793a20796f7520616c72656164792062657420696e2074686973604482015265081c9bdd5b9960d21b60648201526084015b60405180910390fd5b600354821015801561023d57506004548211155b6102895760405162461bcd60e51b815260206004820152601d60248201527f4c6f74746572793a206e756d626572206f7574206f6620626f756e64730000006044820152606401610220565b600754421080159061029c575060085442105b6102e85760405162461bcd60e51b815260206004820152601e60248201527f4c6f74746572793a20726f756e64206e6f7420737461727465642079657400006044820152606401610220565b600081116103475760405162461bcd60e51b815260206004820152602660248201527f4c6f74746572793a20616d6f756e74206d75737420626520677265617465722060448201526507468616e20360d41b6064820152608401610220565b600154604051636eb1769f60e11b815233600482015230602482015282916001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b99190610b14565b10156104075760405162461bcd60e51b815260206004820152601f60248201527f4c6f74746572793a20696e73756666696369656e7420616c6c6f77616e6365006044820152606401610220565b6001546040516370a0823160e01b815233600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa15801561044f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104739190610b14565b10156104c15760405162461bcd60e51b815260206004820152601d60248201527f4c6f74746572793a20696e73756666696369656e742062616c616e63650000006044820152606401610220565b6005546009546104d2908390610b43565b111561052a5760405162461bcd60e51b815260206004820152602160248201527f4c6f74746572793a206d617820746f74616c20616d6f756e74207265616368656044820152601960fa1b6064820152608401610220565b6001546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a59190610b5c565b5060408051808201825283815260208082018481526006546000908152600c8352848120338252909252928120915182559151600190910155600980548392906105f0908490610b43565b9091555050600a805490600061060583610b85565b9091555050600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b03191633908117909155600654604080519182526020820185905281018390527f7363e6581df4db69463222156be4a09656528b9f1302890fa4c0b60819b69fc69060600160405180910390a261069c6001600055565b5050565b6106a8610725565b600854421015806106bd575060055460095410155b6107095760405162461bcd60e51b815260206004820152601c60248201527f4c6f74746572793a20726f756e64206e6f7420656e64656420796574000000006044820152606401610220565b61071161074f565b6107196109b0565b6107236001600055565b565b60026000540361074857604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b60006003546004544244600660050160405160200161077093929190610b9e565b6040516020818303038152906040528051906020012060001c6107939190610bf0565b61079d9190610b43565b60065460408051918252602082018390529192507f8868888cc18628a149bc88cc32a91976ab30e2cd9aececb0cfe184a73fe551f9910160405180910390a1600b5460005b818110156109ab576006546000908152600c60205260408120600b8054869391908590811061081357610813610c12565b60009182526020808320909101546001600160a01b03168352820192909252604001902054036109a3576006546000908152600c60205260408120600b80548391908590811061086557610865610c12565b60009182526020808320909101546001600160a01b03168352820192909252604001902060010154610898906002610c28565b600154600b80549293506001600160a01b039091169163a9059cbb9190859081106108c5576108c5610c12565b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af115801561091e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109429190610b5c565b50600b80548390811061095757610957610c12565b600091825260209182902001546040518381526001600160a01b03909116917f5d6c418cec2d4b92f1c8414ec09c6e3a58c94534413fdc0a906e85eb548a4f54910160405180910390a2505b6001016107e2565b505050565b600680549060006109c083610b85565b90915550504260078190556002546109d791610b43565b60085560006009819055600a8190556040805191825260208201908190529051610a0391600b91610a3c565b506006546040519081527fae4cf40c31a833f14b2aee71da8cb55d5fd1944a9ed5b7696022328921f6e3179060200160405180910390a1565b828054828255906000526020600020908101928215610a91579160200282015b82811115610a9157825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610a5c565b50610a9d929150610aa1565b5090565b5b80821115610a9d5760008155600101610aa2565b60008060408385031215610ac957600080fd5b50508035926020909101359150565b60008060408385031215610aeb57600080fd5b8235915060208301356001600160a01b0381168114610b0957600080fd5b809150509250929050565b600060208284031215610b2657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610b5657610b56610b2d565b92915050565b600060208284031215610b6e57600080fd5b81518015158114610b7e57600080fd5b9392505050565b600060018201610b9757610b97610b2d565b5060010190565b8381526000602084602084015260408301845485600052602060002060005b82811015610be25781546001600160a01b031684529284019260019182019101610bbd565b509198975050505050505050565b600082610c0d57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610b5657610b56610b2d56fea2646970667358221220b8c73a692a0d928662cda82d9328ca11ce36427fc42e310954c75afa675cd8e964736f6c63430008160033000000000000000000000000f0c14ce46ba2657a2982942f121f1484f2f03aec",
"nonce": "0x2",
"chainId": "0x4268"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x1a350d",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0xaab77ec9469dbe1854846fead50c488dd4db2490672c4abfcf68da100686c977",
"transactionIndex": "0x8",
"blockHash": "0x394a1aa701942fb99df63a8f63450b9502d9bb5ffef9af538d7edbc413c82803",
"blockNumber": "0x23f461",
"gasUsed": "0xe429d",
"effectiveGasPrice": "0x3b9aca00",
"from": "0x031c4f04b768bd76ac222cfd91385d848d91ffc7",
"to": null,
"contractAddress": "0xc83ffb298acac98195b485e4c566eab99814ab57"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1726617350,
"chain": 17000,
"commit": "459b498"
}
2 changes: 1 addition & 1 deletion script/DeployLottery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract DeployLottery is Script {

vm.startBroadcast(deployerPrivateKey);

new Lottery(address(0));
new Lottery(address(0xF0c14cE46bA2657A2982942F121F1484f2F03aEC));

vm.stopBroadcast();
}
Expand Down
2 changes: 1 addition & 1 deletion src/AutoLotteryTrap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct CollectOutput {
contract AutoLotteryTrap is ITrap {
// Deployed on Holesky
Lottery private lottery =
Lottery(address(0));
Lottery(address(0xF0c14cE46bA2657A2982942F121F1484f2F03aEC));

function collect() external view returns (bytes memory) {
(,,uint256 endTime,uint256 totalAmount,) = lottery.currentRound();
Expand Down

0 comments on commit 8ad6c6c

Please sign in to comment.