-
Notifications
You must be signed in to change notification settings - Fork 11
chores:added a revamp to the contract and integration test #17
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
Conversation
|
Hello @Samuel1-ona Gm Gm! I will want you to go back to the OpenZeppelin implementation for Ownable, passable and most importantly the reentrancy implementation that open zeppelin provides. The security benefits far outweigh the dependency concerns. You can still keep your improved code organization and better documentation which I soo love, it looks amazing. Let’s go back to using openzeppelin. Thanks a lot for your help and implementation. |
|
@CollinsC1O Please, can you provide a PoC for the security concern? |
Regarding reentrancy, pause and others |
|
@Samuel1-ona |
|
@Samuel1-ona please I would love we maintain the openzeppelin implementations, what do you think |
|
Hello @Samuel1-ona you've been quite and not responded to my messages yet, please let me know from now till tomorrow if you're going to effect the requested changes. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert to using the openzeppelin implementations for ownable, pausable and reentrancy guard.
when you're done with your changes pls remember to format your code, ensure it compiles ans all test passes
|
Hello @Samuel1-ona I will need a commit on the requested changes or a reply from now till tomorrow, that's if you are interested in implementing the changes I pointed out. Thanks a lot |
|
Hello @Samuel1-ona can you use 'scarb fmt' to have your code formatted and resolve the merge conflict |
|
Hello @Samuel1-ona Gm |
|
Hello @Samuel1-ona I need a reply to know where thinks are at with you. I need this issue resolved |
|
I have done the fmt and everything. I think why the check is failing is because of the issue I pointed out earlier, version. As I said, most implementations are not documented yet on that version. |
|
@Samuel1-ona Ok that's alright just get it to compile and all test passing, as it passed before it broke again. we've got other PR passing the build and test check. (#21) so check on what could be making yours fail and ensure its compiling and the test passing so I can merge it. That reminds me, please sync your fork with the main I will need to align the current implementation with yours |
…er token functionality
|
@Samuel1-ona, I have updated the Cairo workflow. The Thank you. |
|
@CollinsC1O @jedstroke There is nothing breaking at the Cairo files. Why this is not passing is because of version 2.11.2. if you run the test code on your terminal, you will get |
|
Thanks a lot for the info @Samuel1-ona I will fix that. Thanks for your help |
A process breaks the Cairo fmt doesn't pass |
The build and test are passing |
@Samuel1-ona But I am not seeing it fail |
@Samuel1-ona, just make the dummy commit push as requested. I am investigating the workflow error |
@Samuel1-ona this is what I am investigating. Nobody said there is anything wrong with your implementation
|
Please share or make a video to show the test passing on your terminal for this particular test case |
@Samuel1-ona Bro, how hard is it for you to push a dummy commit so I can validate the workflow? |
As per your PR |
@Samuel1-ona, the other contributor's test passed as per their PR, and their PR being merged doesn’t impact yours. If I don’t hear back from you within the next 1–4 hours about my request, I’ll go ahead without your PR to keep things moving. Thanks for your understanding — let me know if anything’s blocking you.
|


BigInc Genesis Contract
This PR closes #13
Overview
The BigInc Genesis contract is a comprehensive share management system built on Starknet that allows users to purchase shares using USDT or USDC tokens. The contract includes features for presale management, partner share caps, shareholder tracking, and administrative controls.
🚀 Recent Changes & Revamp
Major Contract Refactoring
The contract has been completely revamped with the following improvements:
1. Simplified Architecture
OwnableComponent,PausableComponent, andReentrancyGuardComponent2. Enhanced Partner Share Cap System
3. Improved Shareholder Management
shareholder_indexmapping for O(1) shareholder removalget_shareholder_count()andget_shareholder_at_index()4. Code Organization
🔧 New Features
Partner Share Cap System
The contract now supports setting share caps for specific partner tokens:
Enhanced Shareholder Management
🧪 Testing
The file
tests/test_partner_share_cap.cairocontains integration tests that demonstrate the partner share cap functionality. However, this is NOT the recommended approach for writing integration tests in Cairo/Starknet for the following reasons:Issues with Current Test Approach:
snforge_stdcheat codes which are more suitable for unit testingRecommended Testing Strategy:
snforge_stdfor testing individual functions in isolationstarknet::testingfor testing contract interactionsVersion Compatibility
📁 Contract Structure
🚀 Key Functions
Core Functions
mint_share(token_address)- Purchase shares with USDT/USDCtransfer_share(to, amount)- Transfer shares to another addressdonate(token_address, amount)- Donate tokens to the contractOwner Functions
withdraw(token_address, amount)- Withdraw tokens from contractseize_shares(shareholder)- Seize shares from a shareholderset_partner_share_cap(token_address, cap)- Set partner share capremove_partner_share_cap(token_address)- Remove partner share cappause()/unpause()- Pause/unpause contract operationsView Functions
get_available_shares()- Get remaining shares for saleget_shares(address)- Get shares owned by addressget_partner_share_cap(token_address)- Get partner share capget_shares_minted_by_partner(token_address)- Get shares minted by partner🔒 Security Features
📊 Share Economics
🛠️ Development
Prerequisites
Build
Test
snforge test