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

refactor(backend): rename array #23

Merged
merged 1 commit into from
Jun 28, 2024
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
7 changes: 7 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat ignition deploy ./ignition/modules/Lock.ts
```

Deployment:

```shell
rm .\ignition\deployments\
npx hardhat ignition deploy .\ignition\modules\SponsorshipQueue.ts --network base_sepolia --verify
```
6 changes: 3 additions & 3 deletions backend/contracts/SponsorshipQueue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Sponsorship {
contract SponsorshipQueue {
address public owner;
uint256 public estimatedCost;
Sponsorship[] public sponsorships;
Sponsorship[] public queue;

event OwnerUpdated(address owner);
event EstimatedCostUpdated(uint256 estimatedCost);
Expand Down Expand Up @@ -47,11 +47,11 @@ contract SponsorshipQueue {
block.timestamp,
msg.sender
);
sponsorships.push(sponsorship);
queue.push(sponsorship);
emit SponsorshipAdded(sponsorship);
}

function getQueueCount() public view returns (uint256) {
return sponsorships.length;
return queue.length;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"SponsorshipQueueModule#SponsorshipQueue": "0x6AD1c8C453fC2532F7E785d8E2a1F5680F467038"
"SponsorshipQueueModule#SponsorshipQueue": "0x9Af2E73663968fdfb9791b7D6Bd40cd259f0388a"
}
8 changes: 4 additions & 4 deletions backend/ignition/deployments/chain-84532/journal.jsonl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{"chainId":84532,"type":"DEPLOYMENT_INITIALIZE"}
{"artifactId":"SponsorshipQueueModule#SponsorshipQueue","constructorArgs":[{"_kind":"bigint","value":"2000000000000000"}],"contractName":"SponsorshipQueue","dependencies":[],"from":"0xa7d1cb88740642dc95774511cc73f015396be869","futureId":"SponsorshipQueueModule#SponsorshipQueue","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","networkInteraction":{"data":"0x608060405234801561001057600080fd5b5060405161083a38038061083a833981810160405281019061003291906100ba565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600181905550506100e7565b600080fd5b6000819050919050565b61009781610084565b81146100a257600080fd5b50565b6000815190506100b48161008e565b92915050565b6000602082840312156100d0576100cf61007f565b5b60006100de848285016100a5565b91505092915050565b610744806100f66000396000f3fe6080604052600436106100705760003560e01c8063880cdc311161004e578063880cdc31146100d35780638da5cb5b146100fc578063a74194af14610127578063d6ed2f061461016657610070565b80633471b337146100755780636e28e29c146100a057806370b62b49146100aa575b600080fd5b34801561008157600080fd5b5061008a610191565b604051610097919061052e565b60405180910390f35b6100a861019e565b005b3480156100b657600080fd5b506100d160048036038101906100cc919061057a565b6102cc565b005b3480156100df57600080fd5b506100fa60048036038101906100f59190610605565b610392565b005b34801561010857600080fd5b50610111610491565b60405161011e9190610641565b60405180910390f35b34801561013357600080fd5b5061014e6004803603810190610149919061057a565b6104b5565b60405161015d9392919061065c565b60405180910390f35b34801561017257600080fd5b5061017b61050f565b604051610188919061052e565b60405180910390f35b6000600280549050905090565b3073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505050600060405180606001604052803481526020014281526020013373ffffffffffffffffffffffffffffffffffffffff1681525090506002819080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f9036e83c8988af3d265365c7dde9b7defca043b13814829c5deb742021a5c4f8816040516102c191906106f3565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610351576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001819055507f33c78a8bf87e9543dd141ff0b40c84fcd144e6d54cadbce6b444da858110887081604051610387919061052e565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610417576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b816040516104869190610641565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600281815481106104c557600080fd5b90600052602060002090600302016000915090508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b60015481565b6000819050919050565b61052881610515565b82525050565b6000602082019050610543600083018461051f565b92915050565b600080fd5b61055781610515565b811461056257600080fd5b50565b6000813590506105748161054e565b92915050565b6000602082840312156105905761058f610549565b5b600061059e84828501610565565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105d2826105a7565b9050919050565b6105e2816105c7565b81146105ed57600080fd5b50565b6000813590506105ff816105d9565b92915050565b60006020828403121561061b5761061a610549565b5b6000610629848285016105f0565b91505092915050565b61063b816105c7565b82525050565b60006020820190506106566000830184610632565b92915050565b6000606082019050610671600083018661051f565b61067e602083018561051f565b61068b6040830184610632565b949350505050565b61069c81610515565b82525050565b6106ab816105c7565b82525050565b6060820160008201516106c76000850182610693565b5060208201516106da6020850182610693565b5060408201516106ed60408501826106a2565b50505050565b600060608201905061070860008301846106b1565b9291505056fea2646970667358221220e52e8d8fc50cba7590c0622f925c9e111a9a9b4ef593acb7765bea608973ad5364736f6c6343000818003300000000000000000000000000000000000000000000000000071afd498d0000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","networkInteractionId":1,"nonce":4,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"1001326"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"1000000"}},"hash":"0xbc851a69c6f8ac3f7500133e10df0426ef22ec5a85d8a108bc74708aab0f852d"},"type":"TRANSACTION_SEND"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","hash":"0xbc851a69c6f8ac3f7500133e10df0426ef22ec5a85d8a108bc74708aab0f852d","networkInteractionId":1,"receipt":{"blockHash":"0x471249cece3489950ea70f09e431932cb4110627f5a8eae3d2a314778d1f7458","blockNumber":11904264,"contractAddress":"0x6AD1c8C453fC2532F7E785d8E2a1F5680F467038","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","result":{"address":"0x6AD1c8C453fC2532F7E785d8E2a1F5680F467038","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","networkInteraction":{"data":"0x608060405234801561001057600080fd5b5060405161083a38038061083a833981810160405281019061003291906100ba565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600181905550506100e7565b600080fd5b6000819050919050565b61009781610084565b81146100a257600080fd5b50565b6000815190506100b48161008e565b92915050565b6000602082840312156100d0576100cf61007f565b5b60006100de848285016100a5565b91505092915050565b610744806100f66000396000f3fe6080604052600436106100705760003560e01c8063880cdc311161004e578063880cdc31146100d35780638da5cb5b146100fc578063d6ed2f0614610127578063ddf0b0091461015257610070565b80633471b337146100755780636e28e29c146100a057806370b62b49146100aa575b600080fd5b34801561008157600080fd5b5061008a610191565b604051610097919061052e565b60405180910390f35b6100a861019e565b005b3480156100b657600080fd5b506100d160048036038101906100cc919061057a565b6102cc565b005b3480156100df57600080fd5b506100fa60048036038101906100f59190610605565b610392565b005b34801561010857600080fd5b50610111610491565b60405161011e9190610641565b60405180910390f35b34801561013357600080fd5b5061013c6104b5565b604051610149919061052e565b60405180910390f35b34801561015e57600080fd5b506101796004803603810190610174919061057a565b6104bb565b6040516101889392919061065c565b60405180910390f35b6000600280549050905090565b3073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505050600060405180606001604052803481526020014281526020013373ffffffffffffffffffffffffffffffffffffffff1681525090506002819080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f9036e83c8988af3d265365c7dde9b7defca043b13814829c5deb742021a5c4f8816040516102c191906106f3565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610351576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001819055507f33c78a8bf87e9543dd141ff0b40c84fcd144e6d54cadbce6b444da858110887081604051610387919061052e565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610417576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b816040516104869190610641565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b600281815481106104cb57600080fd5b90600052602060002090600302016000915090508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b6000819050919050565b61052881610515565b82525050565b6000602082019050610543600083018461051f565b92915050565b600080fd5b61055781610515565b811461056257600080fd5b50565b6000813590506105748161054e565b92915050565b6000602082840312156105905761058f610549565b5b600061059e84828501610565565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105d2826105a7565b9050919050565b6105e2816105c7565b81146105ed57600080fd5b50565b6000813590506105ff816105d9565b92915050565b60006020828403121561061b5761061a610549565b5b6000610629848285016105f0565b91505092915050565b61063b816105c7565b82525050565b60006020820190506106566000830184610632565b92915050565b6000606082019050610671600083018661051f565b61067e602083018561051f565b61068b6040830184610632565b949350505050565b61069c81610515565b82525050565b6106ab816105c7565b82525050565b6060820160008201516106c76000850182610693565b5060208201516106da6020850182610693565b5060408201516106ed60408501826106a2565b50505050565b600060608201905061070860008301846106b1565b9291505056fea2646970667358221220d9836b835cafe1204579cb0ffcd640e262a15b4612db47f778f3ebf5e2a5d2a864736f6c6343000818003300000000000000000000000000000000000000000000000000071afd498d0000","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","networkInteractionId":1,"nonce":5,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"1001210"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"1000000"}},"hash":"0xc56815a6bcf9efe5934922a3fdd2985bfe730c0b203c7c2b6d786e4659ab0fa0"},"type":"TRANSACTION_SEND"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","hash":"0xc56815a6bcf9efe5934922a3fdd2985bfe730c0b203c7c2b6d786e4659ab0fa0","networkInteractionId":1,"receipt":{"blockHash":"0xca9a437abb50a32e21ad1f80e81d57f3ead7e64481126f59ace55b4cabc39d81","blockNumber":11904599,"contractAddress":"0x9Af2E73663968fdfb9791b7D6Bd40cd259f0388a","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"}
{"futureId":"SponsorshipQueueModule#SponsorshipQueue","result":{"address":"0x9Af2E73663968fdfb9791b7D6Bd40cd259f0388a","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"}
Loading