The Mad Scientist and His Future Gadget Lab
In the bustling Akihabara district of Tokyo, a self-proclaimed mad scientist named Okabe Rintarou, better known by his alias Hououin Kyouma, founded the Future Gadget Lab. This eccentric workshop was destined to birth his greatest invention: the PhoneWave (name subject to change), aka time machine.
Okabe's relatively peaceful life takes a dark turn when Makise Kurisu, a brilliant young scientist, is found dead in Akihabara. This event sets off a chain reaction, spiraling towards a catastrophic World War III in the future.
Determined to prevent the war, Okabe decides to construct a time machine, aiming to alter the course of history and, in his words, "Hacking to the gate".
Project Phoenix: Funding the Future
However, Okabe's ambitious plan faces a significant hurdle: funding. His calculations indicate a need for at least $100,000 USD, equivalent to 100 AXC, needed to complete the time machine and prevent World War III.
To secure this funding, Okabe initiates Project Phoenix - a name symbolizing the potential rebirth of a peaceful world. The project's funding mechanism works as follows:
- Investors can lock
AXCinto a smart contract. - For every 10
AXClocked, the investor receives 100FGT(Future Gadget Tokens). FGTcan be redeemed upon the successful completion of theTime Machine.
NoteThe smart contract is so secure, even time travel can't mess with it. (at least, according to Okabe's funding statement).
The Smart Contract Challenge
Okabe lacks the technical expertise to create the necessary smart contract for Project Phoenix and this is where you come in - can you help this mad scientist craft a smart contract that might just save the world?
Your mission is to develop a smart contract that can:
- Accept and lock
AXCdeposits - Calculate and distribute
FGTrewards (Seperate contract) - Lock the
FGTrewards until the Time Machine is completed (Let's say Year 2036)
The smart contract implementation details as follows:
Smart Contract Requirements
-
Contract Creation
- Develop two smart contracts:
LockcontractFGTcontract (an ERC20 token)
- Develop two smart contracts:
-
Lock Contract
- Implement a
lockAXCfunction:- Must be payable
- Each call costs 10 AXC
- Deposit limit: 100 AXC
- Reject new deposits when limit is reached
- Implement a
-
Deposit Tracking
- Add a
totalDepositsfunction to theLockcontract:- Returns the total amount of AXC deposited
- Add a
-
Token Minting
- Restrict
FGTtoken minting:- Only the
Lockcontract can mintFGTtokens
- Only the
- Restrict
-
Token Redemption
- Implement a
redeemfunction in theFGTcontract:- Allows users to redeem their
FGTtokens - Only owner of the
FGTcontract can redeem tokens - Redemption only possible after 2036
- Allows users to redeem their
- Implement a
-
Transfer Restriction
- Implement transfer restrictions in the
FGTcontract:- Users cannot transfer their balance to others before 2036
- Implement transfer restrictions in the