-
Notifications
You must be signed in to change notification settings - Fork 0
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
👻 one click trading connector #25
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import {ERC20} from "solmate/tokens/ERC20.sol"; | ||
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; | ||
import {BaseConnector} from "../utils/BaseConnector.sol"; | ||
|
||
interface IEmitter { | ||
function emitSwap(address from, address to, uint256 amt, uint256 minReceived, uint256 received) external; | ||
} | ||
|
||
interface IExclusiveImpl { | ||
function enableAdditionalAuth(address _user, uint256 _expiry) external; | ||
|
||
function disableAdditionalAuth(address user) external; | ||
} | ||
|
||
interface IDefaultImpl { | ||
function toggleBeta() external; | ||
|
||
function isBeta() external returns(bool); | ||
} | ||
|
||
contract OneClickTrading is BaseConnector { | ||
using SafeTransferLib for ERC20; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
|
||
struct Data { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
uint256 msgValue; | ||
uint256 initialBal; | ||
uint256 finalBal; | ||
ERC20 toToken; | ||
} | ||
|
||
string public constant name = "One-Click-Trading-v1"; | ||
|
||
function enableAuth(address _user, uint256 _expiry) public payable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add events like normal connector |
||
IExclusiveImpl(address(this)).enableAdditionalAuth(_user, _expiry); | ||
} | ||
|
||
function disableAuth(address _user) public payable { | ||
IExclusiveImpl(address(this)).disableAdditionalAuth(_user); | ||
} | ||
|
||
function toggleBeta() public payable { | ||
IDefaultImpl(address(this)).toggleBeta(); | ||
} | ||
|
||
function isBeta() public payable returns (bool){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this |
||
return IDefaultImpl(address(this)).isBeta(); | ||
} | ||
|
||
event LogSwap( | ||
address indexed from, address indexed to, uint256 amt, uint256 minReceived, bytes data, uint256 setId | ||
); | ||
} |
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.
remove