Created
August 29, 2022 13:50
-
-
Save ColinPlatt/85b2acaf9c96e0b70ecb66b483864857 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
interface IMasterChefUserInfo { | |
function userInfo(uint256 pid, address account) external view returns (uint256, uint256); | |
} | |
interface IERC20 { | |
function balanceOf(address account) external view returns (uint256); | |
function totalSupply() external view returns (uint256); | |
} | |
contract MATRIXPOWAH { | |
IMasterChefUserInfo chef = IMasterChefUserInfo(0xfB46cd98ABF79B13b70C789D0fEdAfB6819707B0); | |
function name() external pure returns (string memory) { return "MATRIXPOWAH"; } | |
function symbol() external pure returns (string memory) { return "MATRIXPOWAH"; } | |
function decimals() external pure returns (uint8) { return 18; } | |
function allowance(address, address) external pure returns (uint256) { return 0; } | |
function approve(address, uint256) external pure returns (bool) { return false; } | |
function transfer(address, uint256) external pure returns (bool) { return false; } | |
function transferFrom(address, address, uint256) external pure returns (bool) { return false; } | |
/// @notice Returns SUSHI voting 'powah' for `account`. | |
function balanceOf(address account) external view returns (uint256 powah) { | |
(uint256 lp_stakedBalance, ) = chef.userInfo(0, account); // get LP balance staked in MasterChef | |
powah = lp_stakedBalance; // add xSushi & LP weights for 'powah' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment