-
Notifications
You must be signed in to change notification settings - Fork 2
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: adding pool logic #3
Conversation
kupermind
commented
Oct 27, 2024
- Adding pool logic.
@@ -13,10 +38,38 @@ interface IERC20 { | |||
function approve(address spender, uint256 amount) external returns (bool); | |||
} | |||
|
|||
interface IOracle { |
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.
Oracle for the ETH-USDC pair.
@@ -27,6 +80,12 @@ interface IRollupBridge { | |||
* The remainder of the ETH contributed (90%) is converted to USDC and contributed to an LP, together with 50% of the token supply of the meme. | |||
*/ | |||
contract MemeBase { | |||
event OLASBridgedForBurn(address indexed olas, uint256 amount); |
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.
Just moved around
event Hearted(address indexed user, uint256 amount); | ||
event Unleashed(address indexed memeToken, address indexed lpPairAddress); | ||
event Purged(address indexed memeToken, uint256 remainingAmount); | ||
address[] public memeTokens; |
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.
Let's track all the created tokens
@@ -121,7 +197,7 @@ contract MemeBase { | |||
emit Hearted(msg.sender, msg.value); | |||
} | |||
|
|||
function unleashThisMeme(address memeToken) external { | |||
function unleashThisMeme(address memeToken, uint256 olasSpotPrice) external { |
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.
The olasSpotPrice
is calculated by the balancer SDK
This is good for the price manipulation protection, and it also means that most likely this call will be made by the agent, because one needs to calculate the spot price.
bytes memory data = abi.encodeWithSignature("burn(uint256)", OLASAmount); | ||
|
||
// Bridge OLAS to mainnet | ||
IRollupBridge(rollupBridge).bridgeTokens(olas, OLASAmount, data); | ||
// Bridge OLAS to mainnet to get burned |
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.
Is this correct? What we want is that upon arrival on mainnet, "burn" gets called on OLAS
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.
Reviewed now, we'll have to add a bit more to that. There's no way to have a callback associated with the encoded data, it just stays there for the record in the emit. So we can have a dedicated Burn contract on ETH mainnet side, or send it all to Timelock, and then have a proposal to burn that amount identified by that bridge burn function call.