Skip to content

Commit

Permalink
Merge branch 'main' into avoid-double-clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
wWrongName committed Sep 15, 2023
2 parents 26f1ef1 + 5078a43 commit fb6122d
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 20 deletions.
4 changes: 2 additions & 2 deletions assets/js/components/StakeModalSpaceStation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class StakeModalSpaceStation extends React.Component {
getLinkToPair() {
if (this.props.managedFarmData !== null && this.props.managedFarmData !== undefined) {
let data = this.props.managedFarmData;
return "/#!action=swap&pair=" + data.stake_token_name + "-" + data.reward_token_name + '&from=' + data.stake_token_hash + "&to=" + data.reward_token_hash;
return "/#!action=swap&pair=" + data.stake_token_name + "-" + data.reward_token_name + '&from=' + this.props.mainToken + "&to=" + data.stake_token_hash;
}
}

Expand Down Expand Up @@ -359,7 +359,7 @@ class StakeModalSpaceStation extends React.Component {
onClick={this.switchToSwap.bind(this)}
className="text-color4-link hover-pointer">
{this.props.managedFarmData !== null && this.props.managedFarmData !== undefined &&
<span className="mr-2">{t('dropFarms.getLPToken', {tokenName : this.props.managedFarmData.stake_token_name +'-' + this.props.managedFarmData.reward_token_name})}</span>
<span className="mr-2">{t('dropFarms.getLPToken', {tokenName : this.props.managedFarmData.stake_token_name})}</span>
}
<span className="icon-Icon11"/>
</a>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/components/StakeModalVoting.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class StakeModalVoting extends React.Component {
</Button>
</div>

{this.props.managedFarmData !== null &&
{/* {this.props.managedFarmData !== null &&
<div className="text-center">
<a
href = {this.getLinkToPair()}
Expand All @@ -356,7 +356,7 @@ class StakeModalVoting extends React.Component {
<span className="icon-Icon11"/>
</a>
</div>
}
} */}
</Modal.Body>
</Modal>
</>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/config_test.js → assets/js/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import erc20TokenABI from './../ABI/abi_erc20';
import vaultABI from './../ABI/vault';
import spaceBridgeABI from './../ABI/abi_spaceBridge.json';
import wethABI from './../ABI/abi_weth.json';
import spaceBridgeABI from '../ABI/abi_spaceBridge.json';
import wethABI from '../ABI/abi_weth.json';

export const maxEnqValue = BigInt('18446744073709551615'); //amount in cents
export const bridgeApiURL = 'https://bridge-test.enex.space/api/v1';
Expand Down
20 changes: 13 additions & 7 deletions assets/js/pages/Voting.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import _ from 'lodash';

const valueProcessor = new ValueProcessor();

const voteToken = presets.dropFarms.voting.voteToken


class Voting extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -84,7 +86,7 @@ class Voting extends React.Component {
this.getDataSet()
}, 1000)

this.updateExpandedVote(2)
this.updateExpandedVote(3)
}

componentWillUnmount() {
Expand Down Expand Up @@ -267,8 +269,8 @@ class Voting extends React.Component {
}

updateMainTokenAmount() {
if (this.props.mainToken !== undefined && this.props.balances !== undefined) {
let mainTokenBalance = this.props.balances.find(token => token.token === this.props.mainToken);
if (voteToken !== undefined && this.props.balances !== undefined) {
let mainTokenBalance = this.props.balances.find(token => token.token === voteToken);

if (mainTokenBalance !== undefined) {
let mainTokenAmount = mainTokenBalance.amount;
Expand All @@ -288,7 +290,7 @@ class Voting extends React.Component {
}

updateMainTokenInfo() {
let mainTokenHash = this.props.mainToken
let mainTokenHash = voteToken
let tokenInfoRequest = swapApi.getTokenInfo(mainTokenHash);
tokenInfoRequest.then(result => {
if (!result.lock) {
Expand Down Expand Up @@ -519,7 +521,7 @@ class Voting extends React.Component {
let res = {active: [], past: []}
res = Object.keys(votes).reduce((sortedVotes, voteKey, index) => {
let vote = {...votes[voteKey], voteName : voteKey, voteIndex : index}
if (votes[voteKey].finalBlockNum < this.height || votes[voteKey].forceDeactivation)
if (votes[voteKey].finalBlockNum < this.height || votes[voteKey].forceDeactivation || votes[voteKey].canceled)
sortedVotes.past.push(vote)
else
sortedVotes.active.push(vote)
Expand Down Expand Up @@ -679,9 +681,13 @@ class Voting extends React.Component {
</div>
}
{votes.map(( vote, index ) => {
console.log(this.state.expandedVote, vote.voteIndex)
let tPath = `dropFarms.voting.votes.${vote.voteName}`
let voteTitle = t(`${tPath}.header`, {status: activeVouting ? t('active') : t('inactive')})
let voteTitle
if (vote.canceled) {
voteTitle = t(`${tPath}.header`, {status: t('canceled')})
} else {
voteTitle = t(`${tPath}.header`, {status: activeVouting ? t('active') : t('inactive')})
}
vote.description = t(`${tPath}.description`)
return (
<>
Expand Down
65 changes: 64 additions & 1 deletion assets/store/pageDataPresets.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const presets = {
]
},
voting : {
voteToken : "75798e583350dd0d77e4466e52af16e086adc25895f84c3372bbd2d4ec958248",
votes : {
miningSlots : {
finalBlockNum : 5514240,
Expand Down Expand Up @@ -216,7 +217,7 @@ const presets = {
},
tickerPrefix : {
finalBlockNum : 6061056,
forceDeactivation : false,
forceDeactivation : true,
situationReadme : "",
voutingReadme : "",
resultsReadme : "",
Expand All @@ -236,6 +237,68 @@ const presets = {
]
}
]
},
tuneTokenomics: {
finalBlockNum : 6172544,
forceDeactivation : true,
canceled : true,
situationReadme : "",
voutingReadme : "https://t.me/Enecuum_EN/316613",
resultsReadme : "",
list : [
{
issue : "Extend Max Supply to 2,500,000,000 ENQ",
proposal : "",
farm_ids : [
"119559f5ba540f76d579c240056997a9ddf5a262a04d0bb7e8b7de51f40af549",
]
},
{
issue : "Extend Max Supply to 3,500,000,000 ENQ",
proposal : "",
farm_ids : [
"8ec18b2b7693257cb06857a4ce850ee2c07ca20ad7f071217803e09756eeee52",
]
},
{
issue : "Extend Max Supply to 5,000,000,000 ENQ",
proposal : "",
farm_ids : [
"f99b4a02d88bced756ab029234d8a988aae6efe2cb469b6daecb36697f139c87",
]
},
{
issue : "DAO token proposal",
proposal : "",
farm_ids : [
"e3c91e604480cc57878816afd0320cad1454827f9fcd34d9a95f3f9a968072bb",
]
},
]
},
testVouting : {
finalBlockNum : 6196733,
forceDeactivation : false,
canceled : false,
situationReadme : "",
voutingReadme : "https://blog.enecuum.com/start-of-the-voting-on-trinity-dao-token-f884474f4ac5",
resultsReadme : "",
list : [
{
issue : "Distribute Trinity DAO (governance) token as a drop based on accounts balance and history. Extend Max Supply to 2,500,000,000 ENQ.",
proposal : "",
farm_ids : [
"9b6c30b7674ac670f8383d2a1b495f71390496d173efb4e0b62e899c4051af4d",
]
},
{
issue : "Distribute Trinity DAO (governance) token in exchange for donation to the network developers team budget. Leave Max Supply unchanged.",
proposal : "",
farm_ids : [
"01ef8132546e477a359133683ce31707a71589fdb3c19dc5841381c5751ff10d",
]
},
]
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions public/locales/en/dropFarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,21 @@ module.exports = {
"tickerPrefix" : {
"header" : "Voting about the ticker generation algorithm for tokens issued by the bridge - {{status}}",
"description" : "We have a proposal from the community regarding the ticker generation algorithm for a token issued by a bridge in the destination network. The current process involves adding the prefix \"sb\" to the ticker when creating a token in the destination network. For instance, if a user wants to transfer tokens from network A to network B, and the token does not yet exist in network B, the bridge will issue it in network B with the ticker prefixed as \"sbTST\" (for example, if the original token ticker is TST). However, @anaks77 suggests a modification to this logic. The proposal is to refrain from adding the \"sb\" prefix to the token being created on the destination network."
}
},
"tuneTokenomics" : {
"header" : "Voting about tokenomics tuning - {{status}}",
"description" : "We have a proposal to tune the tokenomics for the future project development."
},
"testVouting" : {
"header" : "Voting about tokenomics tuning - {{status}}",
"description" : "We have a proposal to tune the tokenomics for the future project development."
},
},

"votingTill" : "Voting till: {{block}} block in Enecuum Network (approx.: {{timeStr}})",
"currentBlock" : "Current block: {{block}}",
"readMore1" : "Article",
"readMore2" : "Documentation",
"readMore2" : "Read more",
"readMore3" : "Voting results",
"proposalsTitle" : "Proposals",
"totalVotes" : "Total votes",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/en/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,6 @@ module.exports = {
"pooled" : "Pooled",
"all" : "All",
"active" : "Active",
"inactive" : "Finished"
"inactive" : "Finished",
"canceled" : "Canceled"
}
12 changes: 10 additions & 2 deletions public/locales/ru/dropFarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,21 @@ module.exports = {
"tickerPrefix" : {
"header" : "Voting about the ticker generation algorithm for tokens issued by the bridge - {{status}}",
"description" : "We have a proposal from the community regarding the ticker generation algorithm for a token issued by a bridge in the destination network. The current process involves adding the prefix \"sb\" to the ticker when creating a token in the destination network. For instance, if a user wants to transfer tokens from network A to network B, and the token does not yet exist in network B, the bridge will issue it in network B with the ticker prefixed as \"sbTST\" (for example, if the original token ticker is TST). However, @anaks77 suggests a modification to this logic. The proposal is to refrain from adding the \"sb\" prefix to the token being created on the destination network."
}
},
"tuneTokenomics" : {
"header" : "Voting about tokenomics tuning - {{status}}",
"description" : "We have a proposal to tune the tokenomics for the future project development."
},
"testVouting" : {
"header" : "Voting about tokenomics tuning - {{status}}",
"description" : "We have a proposal to tune the tokenomics for the future project development."
},
},

"votingTill" : "Voting till: {{block}} block in Enecuum Network (approx.: {{timeStr}})",
"currentBlock" : "Current block: {{block}}",
"readMore1" : "Article",
"readMore2" : "Documentation",
"readMore2" : "Read more",
"readMore3" : "Voting results",
"proposalsTitle" : "Proposals",
"totalVotes" : "Total votes",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/ru/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ module.exports = {
"pooled" : "Добавлено в пул",
"all" : "Все",
"active" : "Active",
"inactive" : "Finished"
"inactive" : "Finished",
"canceled" : "Canceled"
}

0 comments on commit fb6122d

Please sign in to comment.