Skip to content

Commit

Permalink
Merge pull request #2395 from ripcurlx/add-multiple-stablecoins
Browse files Browse the repository at this point in the history
List multiple stable coins
  • Loading branch information
ripcurlx authored Feb 12, 2019
2 parents d1faa84 + 3a39e22 commit df753ea
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 0 deletions.
27 changes: 27 additions & 0 deletions assets/src/main/java/bisq/asset/tokens/DaiStablecoin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.tokens;

import bisq.asset.Erc20Token;

public class DaiStablecoin extends Erc20Token {

public DaiStablecoin() {
super("Dai Stablecoin", "DAI");
}
}
27 changes: 27 additions & 0 deletions assets/src/main/java/bisq/asset/tokens/TrueUSD.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.tokens;

import bisq.asset.Erc20Token;

public class TrueUSD extends Erc20Token {

public TrueUSD() {
super("TrueUSD", "TUSD");
}
}
27 changes: 27 additions & 0 deletions assets/src/main/java/bisq/asset/tokens/USDCoin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.tokens;

import bisq.asset.Erc20Token;

public class USDCoin extends Erc20Token {

public USDCoin() {
super("USD Coin", "USDC");
}
}
3 changes: 3 additions & 0 deletions assets/src/main/resources/META-INF/services/bisq.asset.Asset
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@ bisq.asset.coins.ZelCash
bisq.asset.coins.Zero
bisq.asset.coins.ZeroOneCoin
bisq.asset.tokens.AugmintEuro
bisq.asset.tokens.DaiStablecoin
bisq.asset.tokens.EtherStone
bisq.asset.tokens.TrueUSD
bisq.asset.tokens.USDCoin
bisq.asset.tokens.VectorspaceAI
42 changes: 42 additions & 0 deletions assets/src/test/java/bisq/asset/tokens/DaiStablecoinTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.tokens;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class DaiStablecoinTest extends AbstractAssetTest {

public DaiStablecoinTest() {
super(new DaiStablecoin());
}

@Test
public void testValidAddresses() {
assertValidAddress("0x2a65Aca4D5fC5B5C859090a6c34d164135398226");
assertValidAddress("2a65Aca4D5fC5B5C859090a6c34d164135398226");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266");
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d16413539822g");
assertInvalidAddress("2a65Aca4D5fC5B5C859090a6c34d16413539822g");
}
}
42 changes: 42 additions & 0 deletions assets/src/test/java/bisq/asset/tokens/TrueUSDTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.tokens;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class TrueUSDTest extends AbstractAssetTest {

public TrueUSDTest() {
super(new TrueUSD());
}

@Test
public void testValidAddresses() {
assertValidAddress("0xa23579c2f7b462e5fb2e92f8cf02971fe4de4f82");
assertValidAddress("0xdb59b63738e27e6d689c9d72c92c7a12f22161bb");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266");
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d16413539822g");
assertInvalidAddress("2a65Aca4D5fC5B5C859090a6c34d16413539822g");
}
}
42 changes: 42 additions & 0 deletions assets/src/test/java/bisq/asset/tokens/USDCoinTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.tokens;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class USDCoinTest extends AbstractAssetTest {

public USDCoinTest() {
super(new USDCoin());
}

@Test
public void testValidAddresses() {
assertValidAddress("0xb86bb5fc804768db34f1a37da8b719e19af9dffd");
assertValidAddress("0xea82afd93ebfc4f6564f3e5bd823cdef710f75dd");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266");
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d16413539822g");
assertInvalidAddress("2a65Aca4D5fC5B5C859090a6c34d16413539822g");
}
}

0 comments on commit df753ea

Please sign in to comment.