Skip to content

Commit

Permalink
Update supplies.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
wuminzhe authored Mar 25, 2024
1 parent 79f99f7 commit e27760a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/supplies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ def calc_ring_supply(ethereum_rpc, darwinia_rpc, metadata)
##########################
# Calc reserves
##########################
# 1. Reserve on Darwinia Chain
reserve = get_account_info(darwinia_rpc, metadata, '0x081cbab52e2dBCd52F441c7ae9ad2a3BE42e2284')[:ring].to_i
puts "reserve: #{reserve}"

# 2. Ecosystem Development Fund
# 1. Ecosystem Development Fund
token_contract = '0x9469D013805bFfB7D3DEBe5E7839237e535ec483'
# Financing
# 1.1. Financing
financing_address = '0xfa4fe04f69f87859fcb31df3b9469f4e6447921c'
data = "0x70a08231000000000000000000000000#{financing_address[2..]}"
financing =
ethereum_client.eth_call({ to: token_contract, data: })['result'].to_i(
16
).to_f / 10**18

# BD & Marketing
# 1.2. 生态多签
bd_marketing_address = '0x5FD8bCC6180eCd977813465bDd0A76A5a9F88B47'
data = "0x70a08231000000000000000000000000#{bd_marketing_address[2..]}"
bd_marketing =
Expand All @@ -44,7 +40,7 @@ def calc_ring_supply(ethereum_rpc, darwinia_rpc, metadata)

ecosystem_development_fund = financing + bd_marketing

# 3. Treasury
# 2. Treasury
treasury_address = '0x6d6f646c64612f74727372790000000000000000'
treasury =
darwinia_client.eth_get_balance(treasury_address)['result'].to_i(16).to_f / 10**18
Expand All @@ -53,7 +49,7 @@ def calc_ring_supply(ethereum_rpc, darwinia_rpc, metadata)
##########################
# Calc circulating supply
##########################
circulating_supply = total_issuance - (reserve + ecosystem_development_fund + treasury).to_i
circulating_supply = total_issuance - (ecosystem_development_fund + treasury).to_i
puts "circulating_supply: #{circulating_supply}"

{
Expand Down

0 comments on commit e27760a

Please sign in to comment.