Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
d825fd8
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Jul 28, 2022
6dc056f
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Aug 18, 2022
6009a7d
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Aug 31, 2022
8d66687
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 2, 2022
031f91d
fix typo
Sep 2, 2022
207fe9f
fix typo
The-Preem-Palver Sep 3, 2022
5640198
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 3, 2022
52ae9d6
make env=development the default if no env values
The-Preem-Palver Sep 3, 2022
3ce948c
Merge branch 'dev' of https://github.com/Narwallets/meta-vote into dev
The-Preem-Palver Sep 3, 2022
6f46d63
fix deafult test contract name
The-Preem-Palver Sep 5, 2022
685d3bb
lock time slider step: every 15 days
The-Preem-Palver Sep 5, 2022
cc73d13
fix MIN y MAX LOCK DAYS as constant
The-Preem-Palver Sep 5, 2022
fed6c5d
Returning the list of of voters
josemariasosa Sep 5, 2022
60b7e22
Removing json and serde_json dependencies
josemariasosa Sep 5, 2022
a2c1a6a
Wrap cards horizontally
jtruzzi Sep 6, 2022
8f0a0a7
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 6, 2022
e23c740
Merge pull request #77 from Narwallets/jtruzzi/wrapping-cards
leomanza Sep 6, 2022
2ea91a4
Merge pull request #78 from Narwallets/dev
leomanza Sep 6, 2022
7eaaa51
Changing key names for VoterJSON
josemariasosa Sep 6, 2022
685373b
get_voters function
The-Preem-Palver Sep 6, 2022
cae1b9c
Formatting VoterJSON (#79)
josemariasosa Sep 6, 2022
03f7749
docs to main (#80)
josemariasosa Sep 6, 2022
78e2210
Update README.md
josemariasosa Sep 8, 2022
304238d
[ADD] wallet-connect and upgrade to v7.0.1
Calcifer1001 Sep 12, 2022
377c210
[FIX] lock max validation
Calcifer1001 Sep 12, 2022
3952316
Merge branch 'dev' of https://github.com/Narwallets/meta-vote into dev
leomanza Sep 12, 2022
2bf1014
add nightly wallet
leomanza Sep 12, 2022
ff2da15
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 12, 2022
61ca57e
Merge branch 'dev'
leomanza Sep 12, 2022
09aa284
Merge pull request #81 from Narwallets/dev
leomanza Sep 12, 2022
2d86a65
remove ledger from ws
leomanza Sep 12, 2022
c45bacf
Merge pull request #82 from Narwallets/manza/remove_ledget_from_ws
leomanza Sep 12, 2022
4cc0b18
Merge pull request #83 from Narwallets/dev
leomanza Sep 12, 2022
ea5e343
live update data of votes in metavote
Sep 13, 2022
557085f
add constants to vercel
Sep 13, 2022
b62edc6
Merge pull request #84 from Narwallets/front/live-update-data
leomanza Sep 13, 2022
ad01dea
add metavote favicon
leomanza Sep 13, 2022
effbff1
Merge pull request #86 from Narwallets/manza/favicon
leomanza Sep 13, 2022
ef679fa
update favicon
leomanza Sep 13, 2022
61e2740
Merge pull request #88 from Narwallets/manza/favicon
leomanza Sep 13, 2022
9901f7c
parse int constants
Sep 14, 2022
226fb57
Merge pull request #89 from Narwallets/front/live-update-data
Sep 14, 2022
b4a975d
Merge pull request #90 from Narwallets/dev
leomanza Sep 15, 2022
b06bb75
Update README.md
josemariasosa Sep 15, 2022
4d25940
change yep to yes
Sep 16, 2022
ea8c50a
temporal changes
Sep 19, 2022
2833549
update get more meta link
Sep 19, 2022
90d947f
Merge pull request #91 from Narwallets/front/small-updates
leomanza Sep 19, 2022
9ef795a
add atufocus on lock modal
Sep 19, 2022
c3bbbe7
Merge pull request #92 from Narwallets/front/autofocus-lock
Sep 19, 2022
f5fc0d0
Merge pull request #93 from Narwallets/dev
leomanza Sep 19, 2022
97fb973
fix walletconnect sign out error
leomanza Sep 21, 2022
99ea6db
add panic error message on lock
leomanza Sep 21, 2022
b900ef2
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 21, 2022
bee1440
Merge pull request #96 from Narwallets/add_panic_error_for_lock
Sep 21, 2022
433dbe7
Merge pull request #95 from Narwallets/ws/fix_wallet_connect_sign_out…
Sep 21, 2022
d95fba0
Merge pull request #97 from Narwallets/dev
Sep 21, 2022
1431790
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 21, 2022
f95961a
change default days
Sep 22, 2022
833d3f0
Merge pull request #98 from Narwallets/front/change-default-lock-days
Sep 22, 2022
6fd58fd
Merge pull request #99 from Narwallets/dev
Sep 22, 2022
f56283a
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Sep 22, 2022
8b42509
add my near wallet
leomanza Sep 22, 2022
d449dc8
Merge pull request #100 from Narwallets/manza/add_my_near_wallet
leomanza Sep 22, 2022
3e0b2be
fix reactQuery QueryClient creation
leomanza Sep 26, 2022
0e2d06b
Merge pull request #101 from Narwallets/dev
leomanza Oct 5, 2022
78208d9
fix accountId on nightly
leomanza Oct 10, 2022
dcf6565
modal changes
Oct 10, 2022
15c2725
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Oct 10, 2022
ca7bd0c
check error result tx
Oct 10, 2022
8e0aa2f
Merge pull request #102 from Narwallets/front/lock-modal-error
leomanza Oct 10, 2022
458cd6b
+ page blocker
leomanza Oct 10, 2022
0c87633
Merge pull request #103 from Narwallets/page-blocker
leomanza Oct 10, 2022
77ed4e8
fix disable blocker
leomanza Oct 11, 2022
fd2ce27
Merge pull request #104 from Narwallets/page-blocker
leomanza Oct 11, 2022
0eedd33
adjust vote cards titles
Oct 12, 2022
abd9ee9
tab selection
Oct 12, 2022
3bfd655
Merge pull request #105 from Narwallets/front/adjust-vote-cards-list
Oct 12, 2022
c01b3e8
add here wallet
leomanza Oct 20, 2022
9667097
Merge pull request #106 from Narwallets/add_here_wallet
leomanza Oct 24, 2022
6d7fe3b
hotfix unvote
Nov 2, 2022
b218327
[ADD] meteor wallet
Calcifer1001 Nov 15, 2022
51e2c40
[MOD] cast setupMeteorWallet to proper object
Calcifer1001 Nov 15, 2022
cd9182c
fix page blocker bug with toast
Nov 21, 2022
7db7307
change type folder
Nov 22, 2022
6c3d581
Merge pull request #108 from Narwallets/dev
Nov 28, 2022
fb76d05
avoid exception when no votes added
leomanza Nov 28, 2022
d7f98c2
get meta WIP
leomanza Nov 28, 2022
1f2fb04
fix build
leomanza Nov 28, 2022
cb3f433
remove ts file ext as page ext (no apis)
leomanza Nov 28, 2022
53154bb
Merge branch 'dev' into manza/get_meta_wip
leomanza Nov 28, 2022
e08d541
fix get stnear balance
leomanza Nov 28, 2022
7d135bf
Merge pull request #110 from Narwallets/manza/fix_get_vote_panick
leomanza Nov 30, 2022
a3b8561
general fixes
leomanza Nov 30, 2022
3af45c2
Merge pull request #111 from Narwallets/manza/get_meta_wip
leomanza Nov 30, 2022
056ee16
getmeta coming soon feature flag
leomanza Dec 2, 2022
0b03a68
Merge pull request #112 from Narwallets/manza/get_meta_coming_soon_fe…
leomanza Dec 2, 2022
05fe929
Metavote to main (#113)
josemariasosa Dec 5, 2022
87073d0
Merge pull request #107 from Narwallets/calcifer1001/meteor
leomanza Dec 5, 2022
2a8c605
adjust links in metavote
Dec 13, 2022
9691ade
adjust links in metavote
Dec 13, 2022
66f9f31
Vesting $META info tooltip
leomanza Jan 5, 2023
2aa4589
Merge pull request #116 from Narwallets/manza/add_vesting_info_tooltip
leomanza Jan 5, 2023
643eda0
added unlocked amount
leomanza Jan 5, 2023
184d0dc
Merge pull request #117 from Narwallets/manza/add_vesting_info_tooltip
leomanza Jan 5, 2023
d805d69
Merge branch 'main' of https://github.com/Narwallets/meta-vote
leomanza Jan 6, 2023
4934f0c
Vesting $META info tooltip
leomanza Jan 5, 2023
eb15105
added unlocked amount
leomanza Jan 5, 2023
f3e8e89
Merge pull request #118 from Narwallets/vesting_meta_info_tooltip
leomanza Jan 7, 2023
ff5eef5
Merge pull request #119 from Narwallets/main
Jan 9, 2023
0c77cf8
Merge pull request #115 from Narwallets/dev
Jan 9, 2023
79a216c
upgrade here wallet 7.4.0
Jan 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ front/.vercel

# typescript
front/*.tsbuildinfo
.npmrc
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Implementation of a general voting system using the $META token.

The last version of the deployed contract, in Near `mainnet`, is in the `stable` branch.

Current stable version: [**v0.1.0**](https://github.com/Narwallets/meta-vote/releases/tag/v0.1.0)
Current stable version: [**v0.1.1**](https://github.com/Narwallets/meta-vote/releases/tag/v0.1.1)
Check all releases in [Meta Vote Releases](https://github.com/Narwallets/meta-vote/releases).

To get the stable version, run the commands:
Expand All @@ -18,7 +18,7 @@ git clone https://github.com/Narwallets/meta-vote.git
cd meta-vote
git fetch origin --tags

git checkout tags/v0.1.0 -b stable
git checkout tags/v0.1.1 -b stable
```

## Type Notation
Expand Down Expand Up @@ -67,9 +67,24 @@ pub fn new(
) -> Self;
```

The best way to deploy Meta Vote is using the scripts for `mainnet` and `testnet`:

- [main_deploy.sh](contract/scripts/main_deploy.sh)
- [test_deploy.sh](contract/scripts/test_deploy.sh)

## Getting a list of paginated Voters

Getting all the voters with pagination using `testnet`:

```rs
NEAR_ENV=testnet near view metavote.testnet get_voters '{"from_index": 0, "limit": 100}'
```

## View Contract Functions

```rs
pub fn get_voters(&self, from_index: u32, limit: u32) -> Vec<VoterJSON>;

pub fn get_balance(&self, voter_id: VoterId) -> U128;

pub fn get_locked_balance(&self, voter_id: VoterId) -> U128;
Expand Down
2 changes: 1 addition & 1 deletion contract/meta-vote-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
near-sdk = "4.0.0"
near-contract-standards = "4.0.0"
uint = "0.9.3"
uint = "0.9.3"
22 changes: 19 additions & 3 deletions contract/meta-vote-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use near_sdk::json_types::U128;
use near_sdk::{env, log, near_bindgen, AccountId, Balance, PanicOnDefault, require};
use types::*;
use utils::{generate_hash_id, get_current_epoch_millis};
use voter::Voter;
use voter::{Voter, VoterJSON};

mod constants;
mod deposit;
Expand Down Expand Up @@ -555,6 +555,21 @@ impl MetaVoteContract {
/* View functions */
/**********************/

pub fn get_voters(&self, from_index: u32, limit: u32) -> Vec<VoterJSON> {
let keys = self.voters.keys_as_vector();
let voters_len = keys.len() as u64;
let start = from_index as u64;
let limit = limit as u64;

let mut results = Vec::<VoterJSON>::new();
for index in start..std::cmp::min(start + limit, voters_len) {
let voter_id = keys.get(index).unwrap();
let voter = self.voters.get(&voter_id).unwrap();
results.push(voter.to_json(voter_id));
}
results
}

pub fn get_balance(&self, voter_id: VoterId) -> U128 {
let voter = self.internal_get_voter(&voter_id);
let balance = voter.balance + voter.sum_unlocked();
Expand Down Expand Up @@ -631,8 +646,9 @@ impl MetaVoteContract {
&self,
contract_address: ContractAddress
) -> Vec<VotableObjectJSON> {
let objects = self.votes.get(&contract_address)
.expect("Contract Address not in Meta Vote.");
let objects = self.votes.get(&contract_address)
.unwrap_or(UnorderedMap::new(StorageKey::Votes));

let mut results: Vec<VotableObjectJSON> = Vec::new();
for (id, voting_power) in objects.iter() {
results.push(
Expand Down
2 changes: 1 addition & 1 deletion contract/meta-vote-contract/src/locking_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl LockingPosition {
unlocking_started_at: self.unlocking_started_at,
is_unlocked: self.is_unlocked(),
is_unlocking: self.is_unlocking(),
is_locked: self.is_locked(),
is_locked: self.is_locked()
}
}
}
Expand Down
43 changes: 41 additions & 2 deletions contract/meta-vote-contract/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ fn test_single_deposit() {
msg.parse::<Days>().unwrap()
);
assert_eq!(vote_power, voter.voting_power, "Incorrect voting power calculation!");

let voters = contract.get_voters(0, 10);
assert_eq!(voters.len(), 1);
let locking_position = &voters.first().unwrap().locking_positions;
assert_eq!(locking_position.len(), 1);
let vote_position = &voters.first().unwrap().vote_positions;
assert_eq!(vote_position.len(), 0);
}

#[test]
Expand Down Expand Up @@ -105,6 +112,13 @@ fn test_multiple_deposit_same_locking_period() {
contract.get_balance(sender_id.clone()),
"Incorrect balance!"
);

let voters = contract.get_voters(0, 10);
assert_eq!(voters.len(), 1);
let locking_position = &voters.first().unwrap().locking_positions;
assert_eq!(locking_position.len(), 1);
let vote_position = &voters.first().unwrap().vote_positions;
assert_eq!(vote_position.len(), 0);
}

#[test]
Expand Down Expand Up @@ -147,7 +161,6 @@ fn test_multiple_deposit_diff_locking_period() {
);
testing_env!(context.clone());
assert_eq!(

U128::from(total_vote_power),
contract.get_available_voting_power(sender_id.clone()),
"Incorrect voting power calculation!"
Expand All @@ -164,6 +177,13 @@ fn test_multiple_deposit_diff_locking_period() {
contract.get_balance(sender_id.clone()),
"Incorrect balance!"
);

let voters = contract.get_voters(0, 10);
assert_eq!(voters.len(), 1);
let locking_position = &voters.first().unwrap().locking_positions;
assert_eq!(locking_position.len(), 2);
let vote_position = &voters.first().unwrap().vote_positions;
assert_eq!(vote_position.len(), 0);
}

#[test]
Expand Down Expand Up @@ -748,10 +768,16 @@ fn test_clear_locking_position() {
Meta::from(contract.get_balance(sender_id.clone())),
"Incorrect balance!"
);

let voters = contract.get_voters(0, 10);
assert_eq!(voters.len(), 1);
let locking_position = &voters.first().unwrap().locking_positions;
assert_eq!(locking_position.len(), 0);
let vote_position = &voters.first().unwrap().vote_positions;
assert_eq!(vote_position.len(), 0);
}

#[test]

#[should_panic(expected="Not enough free voting power to unlock! You have 0, required 20370370370370370370370370.")]
fn test_unlock_position_without_voting_power() {
const LOCKING_PERIOD: u64 = 100;
Expand Down Expand Up @@ -873,6 +899,13 @@ fn test_rebalance_increase_and_decrease() {
let votes_for_address = voter.get_votes_for_address(&sender_id, &contract_address);
let votes = votes_for_address.get(&votable_object_id).unwrap();
assert_eq!(votes, u128::from(additional_votes), "Incorrect Voting Power calculation.");

let voters = contract.get_voters(0, 10);
assert_eq!(voters.len(), 1);
let locking_position = &voters.first().unwrap().locking_positions;
assert_eq!(locking_position.len(), 1);
let vote_position = &voters.first().unwrap().vote_positions;
assert_eq!(vote_position.len(), 1);
}

#[test]
Expand Down Expand Up @@ -1009,4 +1042,10 @@ fn test_multi_voter_contract() {
"Incorrect vote count for project 2, object 1."
);

let voters = contract.get_voters(0, 10);
assert_eq!(voters.len(), 4);
let locking_position = &voters.first().unwrap().locking_positions;
assert_eq!(locking_position.len(), 1);
let vote_position = &voters.first().unwrap().vote_positions;
assert_eq!(vote_position.len(), 1);
}
10 changes: 9 additions & 1 deletion contract/meta-vote-contract/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ construct_uint! {
pub struct U256(4);
}

#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Debug)]
#[serde(crate = "near_sdk::serde")]
pub struct LockingPositionJSON {
pub index: Option<PositionIndex>,
Expand All @@ -37,3 +37,11 @@ pub struct VotableObjectJSON {
pub id: VotableObjId,
pub current_votes: U128
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(crate = "near_sdk::serde")]
pub struct VotePositionJSON {
pub votable_address: AccountId,
pub votable_object_id: String,
pub voting_power: U128
}
40 changes: 40 additions & 0 deletions contract/meta-vote-contract/src/voter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
use crate::*;
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
#[serde(crate = "near_sdk::serde")]
pub struct VoterJSON {
pub voter_id: AccountId,
pub locking_positions: Vec<LockingPositionJSON>,
pub voting_power: U128,
pub vote_positions: Vec<VotePositionJSON>
}

#[derive(BorshDeserialize, BorshSerialize)]
pub struct Voter {
Expand Down Expand Up @@ -117,4 +127,34 @@ impl Voter {
}
result
}

pub(crate) fn to_json(&self, voter_id: VoterId) -> VoterJSON {
let mut locking_positions = Vec::<LockingPositionJSON>::new();
for index in 0..self.locking_positions.len() {
let pos = self.locking_positions.get(index).unwrap();
locking_positions.push(pos.to_json(Some(index)));
}

let mut vote_positions = Vec::<VotePositionJSON>::new();
for address in self.vote_positions.keys_as_vector().iter() {
let pos = self.vote_positions.get(&address).unwrap();
for obj in pos.keys_as_vector().iter() {
let value = pos.get(&obj).unwrap();
vote_positions.push(
VotePositionJSON {
votable_address: address.clone(),
votable_object_id: obj,
voting_power: U128::from(value)
}
);
}
}

VoterJSON {
voter_id,
locking_positions,
voting_power: U128::from(self.voting_power),
vote_positions
}
}
}
5 changes: 4 additions & 1 deletion front/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ NEXT_PUBLIC_METAPOOL_CONTRACT_ID=
NEXT_PUBLIC_META_CONTRACT_ID=
NEXT_PUBLIC_CONTRACT_ADDRESS_METAVOTE=
NEXT_PUBLIC_GA_TRACKING_ID=
NEXT_PUBLIC_VERCEL_ENV=
NEXT_PUBLIC_VOTES_REFETCH_INTERVAL=
NEXT_PUBLIC_VOTER_DATA_REFETCH_INTERVAL=
NEXT_PUBLIC_VERCEL_ENV=
NEXT_PUBLIC_GET_META_CONTRACT=
8 changes: 4 additions & 4 deletions front/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getConfig = (env: string) => {
helperUrl: "https://helper.mainnet.near.org",
explorerUrl: "https://explorer.mainnet.near.org",
metapoolUrl: "https://metapool.app/dapp/mainnet/meta",
refFinance: "https://www.ref.finance/",
refFinance: "https://app.ref.finance/#meta-pool.near%7Cmeta-token.near",
metayieldUrl: "https://metayield.app"

};
Expand All @@ -27,7 +27,7 @@ export const getConfig = (env: string) => {
helperUrl: "https://helper.testnet.near.org",
explorerUrl: "https://explorer.testnet.near.org",
metapoolUrl: "https://metapool.app/dapp/testnet/meta",
refFinance: "https://www.ref.finance/",
refFinance: "https://app.ref.finance/#meta-pool.near%7Cmeta-token.near",
metayieldUrl: "https://metayield.app"
};
case "betanet":
Expand All @@ -39,7 +39,7 @@ export const getConfig = (env: string) => {
helperUrl: "https://helper.betanet.near.org",
explorerUrl: "https://explorer.betanet.near.org",
metapoolUrl: "https://metapool.app/dapp/testnet/meta",
refFinance: "https://www.ref.finance/",
refFinance: "https://app.ref.finance/#meta-pool.near%7Cmeta-token.near",
metayieldUrl: "https://metayield.app"
};
case "local":
Expand All @@ -49,7 +49,7 @@ export const getConfig = (env: string) => {
keyPath: `${process.env.HOME}/.near/validator_key.json`,
walletUrl: "http://localhost:4000/wallet",
metapoolUrl: "https://metapool.app/dapp/testnet/meta",
refFinance: "https://www.ref.finance/",
refFinance: "https://app.ref.finance/#meta-pool.near%7Cmeta-token.near",
contractName: CONTRACT_NAME,
metayieldUrl: "https://metayield.app"
};
Expand Down
25 changes: 23 additions & 2 deletions front/constants/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
export const MIN_LOCK_DAYS = 30;
export const DEFAULT_LOCK_DAYS = 90;

export const CONTRACT_ADDRESS = process.env.NEXT_PUBLIC_CONTRACT_ADDRESS_METAVOTE;
export const MAX_LOCK_DAYS = 300;

export const MODAL_DURATION = {
LONG: 9000,
SUCCESS: 3000,
ERROR: 5000
}

export const FETCH_VOTES_INTERVAL = process.env.NEXT_PUBLIC_VOTER_DATA_REFETCH_INTERVAL ? parseInt(process.env.NEXT_PUBLIC_VOTER_DATA_REFETCH_INTERVAL) : 5000;
export const FETCH_VOTER_DATA_INTERVAL = process.env.NEXT_PUBLIC_VOTES_REFETCH_INTERVAL ? parseInt(process.env.NEXT_PUBLIC_VOTES_REFETCH_INTERVAL) : 5000;
export const FETCH_WHITELISTED_TOKENS_INTERVAL = 10000;
export const FETCH_METAPOOL_STATE_INTERVAL = 2000;
export const FETCH_NEAR_PRICE_INTERVAL = 2000;
export const FETCH_TOKEN_BALANCE_INTERVAL = 5000;

export const GET_META_DEFAULT_SLIPPAGE = 0.3;
export const GET_META_MIN_SLIPPAGE = 0.01;
export const GET_META_ENABLED = (process.env.NEXT_PUBLIC_ENABLE_GET_META && process.env.NEXT_PUBLIC_ENABLE_GET_META == "true") || false;

export const CONTRACT_ADDRESS = process.env.NEXT_PUBLIC_CONTRACT_ADDRESS_METAVOTE||"metayield.app";

export const enum ACTION_TYPE {
RELOCK,
Expand All @@ -13,7 +34,7 @@ export const MODAL_TEXT = {
UNLOCK: {
CONFIRM: {
title: `Start unlocking`,
text: `Are you sure you want to start unlocking this position? Your tokens will be releases when the locking period ends.`
text: `Are you sure you want to start unlocking this position? Your tokens will be released when the locking period ends.`
},
ERROR_NOT_ENOUGH: {
title: `Not Enough Available Voting Power`,
Expand Down
11 changes: 9 additions & 2 deletions front/constants/whitelist.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
export const WHITELIST_SITES = [
{
platform: 'metayield.app',
isologo: 'metayield_iso.png'
isologo: 'metayield_iso.png',
url: 'https://metayield.app/vote/'
},
{
platform: 'metapool.app',
isologo: 'metapool_iso.png'
isologo: 'metapool_iso.png',
url: 'https://vote.metapool.app/'
},
{
platform: 'metastaking.app',
isologo: 'metapool_iso.png',
url: 'https://vote.metapool.app/'
},
]
Loading