bancor 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bfa4cb3e5cd8debc116acd391aa3fd653dd5067bba326ab756a0217b3d19930
4
- data.tar.gz: c8713fe1b8f4ce702611d5f480acfbd0c96bf25badf7b35891b1a67fdaaa2e7e
3
+ metadata.gz: ae25d17857d3396f99a8c375c8369e71db5365cbd38f5908b52bd5648d70afdb
4
+ data.tar.gz: 5f2a6eb131ab0b47b2e32eb1a5a01c787517f6048b285eff20225d01873f7cb9
5
5
  SHA512:
6
- metadata.gz: c90407a6b893d3497b5fde69fe9d856dfb816d5ebfb6e8aeaf19168cfed4e0536ffe46b62f68d38e0e348a66472d91646823aa8e0642c0a3ca2288903e7cb6fa
7
- data.tar.gz: 754d2dc25b28db0acae690d675a7a6958dcb4db27b62732c554893e37d92f1a75e25e6c9866c28b7f0ca48d79f46eddb34718de4c12547d9db29aad400e4263f
6
+ metadata.gz: 10e6f9781b2409186762fbf034a39df7564955d0850f2e4385c9c511724c8e8bd1bf6897e649015f1554180d1afeb31f665d237d60cd58d8006276e8e42ff86e
7
+ data.tar.gz: 33091d4938eccd6c71d22c82609898ef11038a8e7a1db0b7f6db1bc992e6992a8a514b01a41e97fad9d0b9f98e65c592b55018c757c7755fa397f2b0f9f77099
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bancor (0.1.2)
4
+ bancor (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -11,32 +11,36 @@ module Bancor
11
11
  @crr = crr
12
12
  end
13
13
 
14
- def buy(quantity)
15
- token = @total_supply * (((1 + (quantity / @reserved_token)) ** @crr) - 1)
16
- @reserved_token = @reserved_token + quantity
17
- @total_supply = @total_supply + token
14
+ def issue_by_reserve_token(amount)
15
+ smart_token_amount = @total_supply * (((1 + (amount / @reserved_token)) ** @crr) - 1)
16
+ @reserved_token = @reserved_token + amount
17
+ @total_supply = @total_supply + smart_token_amount
18
18
  @price = @reserved_token / (@total_supply * @crr)
19
+ smart_token_amount
19
20
  end
20
21
 
21
- def sell(quantity)
22
- token = @reserved_token * (1 - ((1 - (quantity / @total_supply)) ** (1/@crr)))
23
- @reserved_token = @reserved_token - token
24
- @total_supply = @total_supply - quantity
22
+ def destroy_by_reserve_token(amount)
23
+ smart_token_amount = @reserved_token * (1 - ((1 - (amount / @total_supply)) ** (1/@crr)))
24
+ @reserved_token = @reserved_token - smart_token_amount
25
+ @total_supply = @total_supply - amount
25
26
  @price = @reserved_token / (@total_supply * @crr)
27
+ smart_token_amount
26
28
  end
27
29
 
28
- def pricing_to_buy(quantity)
29
- @transaction_price = @reserved_token * ((((quantity / @total_supply) + 1) ** (1/@crr)) - 1)
30
- @total_supply = @total_supply + quantity
31
- @reserved_token = @reserved_token + @transaction_price
30
+ def issue_by_smart_token(amount)
31
+ transaction_price = @reserved_token * ((((amount / @total_supply) + 1) ** (1/@crr)) - 1)
32
+ @total_supply = @total_supply + amount
33
+ @reserved_token = @reserved_token + transaction_price
32
34
  @price = @reserved_token / (@total_supply * @crr)
35
+ transaction_price
33
36
  end
34
37
 
35
- def pricing_to_sell(quantity)
36
- @transaction_price = @reserved_token * (1 - ((1 - (quantity / @total_supply)) ** (1/@crr)))
37
- @total_supply = @total_supply - quantity
38
- @reserved_token = @reserved_token - @transaction_price
38
+ def destroy_by_smart_token(amount)
39
+ transaction_price = @reserved_token * (1 - ((1 - (amount / @total_supply)) ** (1/@crr)))
40
+ @total_supply = @total_supply - amount
41
+ @reserved_token = @reserved_token - transaction_price
39
42
  @price = @reserved_token / (@total_supply * @crr)
43
+ transaction_price
40
44
  end
41
45
  end
42
46
  end
@@ -1,3 +1,3 @@
1
1
  module Bancor
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bancor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuta Kurotaki