Skip to content
Permalink
Browse files

single badge sharing and withdrawing

  • Loading branch information...
Austin
Austin committed May 15, 2019
1 parent cceb96d commit 417183a1a55b0795120b953ac084040f8bdc640f
Showing with 16 additions and 4 deletions.
  1. +3 −0 deployFairtags.sh
  2. +9 −0 src/App.js
  3. +4 −4 tests/clevis.js
@@ -0,0 +1,3 @@
#!/bin/bash
#npm run build &&
./node_modules/clevis/bin.js upload fairtags.xdai.io && ./node_modules/clevis/bin.js invalidate ETOJ2KIKRPHE8
@@ -448,13 +448,15 @@ class App extends Component {
async poll() {

let badgeBalance = 0
let singleBadgeId
if(this.state.contracts&&(this.state.network=="xDai"||this.state.network=="Unknown") && this.state.contracts.Badges){
//check for badges for this user
badgeBalance = await this.state.contracts.Badges.balanceOf(this.state.account).call()
if(badgeBalance>0){
let update = false
for(let b = 0;b<badgeBalance;b++){
let thisBadgeId = await this.state.contracts.Badges.tokenOfOwnerByIndex(this.state.account,b).call()
singleBadgeId = thisBadgeId
if(!this.state.badges[thisBadgeId]){

let thisBadgeData = await this.state.contracts.Badges.tokenURI(thisBadgeId).call()
@@ -559,9 +561,16 @@ class App extends Component {
}

this.setState({ethBalance,daiBalance,xdaiBalance,badgeBalance,hasUpdateOnce:true})

if(xdaiBalance < 0.01 && singleBadgeId && !this.state.switchedToSingleBadge){
this.setState({switchedToSingleBadge:true})
this.selectBadge(singleBadgeId)
}

}



}
longPoll() {
axios.get("https://api.coinmarketcap.com/v2/ticker/1027/")
@@ -172,21 +172,21 @@ module.exports = {

result = await clevis("send","0.10","0","0xa9887c69538ccf8692066e0fd5d12a9593ab0403")///<<<-------- change this to your metamask accounts
printTxResult(result)
result = await clevis("send","0.10","0","0x3baa2f6302ce57eb2ad94c9571b19e1073b079be")///<<<-------- change this to your metamask accounts
result = await clevis("send","0.10","0","0x3a48736d0e60b77e8fbe6791372091e1ba80c590")///<<<-------- change this to your metamask accounts
printTxResult(result)

result = await clevis("send","0.10","0","0x3606affd391d37a0f413c261bd3caf573c6360e1")///<<<-------- change this to your metamask accounts
result = await clevis("send","0.001","0","0x0876a604b2e4455fdfee24f042e1c95cb8cd4603")///<<<-------- change this to your metamask accounts
printTxResult(result)

result = await clevis("contract","mintNextTokenWithTokenURI","Badges","0","0x75b459791dad37746ba60c8665a065e1255bff63","https://badges.xdai.io/ethdenver/v1/json/buffalo.json")
printTxResult(result)


result = await clevis("contract","mintNextTokenWithTokenURI","Badges","0","0xa5f4accb90f15d2c813b07a514b0ff4886c4064e","https://badges.xdai.io/ethdenver/v1/json/buffalo.json")
result = await clevis("contract","mintNextTokenWithTokenURI","Badges","0","0x0876a604b2e4455fdfee24f042e1c95cb8cd4603","https://badges.xdai.io/ethdenver/v1/json/buffalo.json")
printTxResult(result)


result = await clevis("contract","mintNextTokenWithTokenURI","Badges","0","0x75b459791dad37746ba60c8665a065e1255bff63","https://badges.xdai.io/ethdenver/v1/json/buffalo.json")
result = await clevis("contract","mintNextTokenWithTokenURI","Badges","0","0x3a48736d0e60b77e8fbe6791372091e1ba80c590","https://badges.xdai.io/ethdenver/v1/json/buffalo.json")
printTxResult(result)

result = await clevis("send","0.10","0","0x75b459791dad37746ba60c8665a065e1255bff63")///<<<-------- change this to your metamask accounts

0 comments on commit 417183a

Please sign in to comment.
You can’t perform that action at this time.