upsideos_evm_rwa_artifacts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +95 -0
- data/data/recallable-payment/abi/AccessControl.json +1 -0
- data/data/recallable-payment/abi/RecallablePayment.json +1 -0
- data/data/recallable-payment/manifest.json +1 -0
- data/data/recallable-payment/verification-source-codes.json +1 -0
- data/data/v5/abi/AccessControl.json +1 -0
- data/data/v5/abi/ERC2771CustomForwarder.json +1 -0
- data/data/v5/abi/IdentityRegistry.json +1 -0
- data/data/v5/abi/InterestPayment.json +1 -0
- data/data/v5/abi/PurchaseContract.json +1 -0
- data/data/v5/abi/RestrictedLockupToken.json +1 -0
- data/data/v5/abi/RestrictedLockupTokenExtension.json +1 -0
- data/data/v5/abi/RestrictedLockupTokenManagementExtension.json +1 -0
- data/data/v5/abi/RestrictedSwap.json +1 -0
- data/data/v5/abi/SnapshotPeriods.json +1 -0
- data/data/v5/abi/TransferRules.json +1 -0
- data/data/v5/abi/merged/RestrictedLockupToken.json +1 -0
- data/data/v5/manifest.json +1 -0
- data/data/v5/verification-source-codes.json +1 -0
- data/data/v5.1/abi/AccessControl.json +1 -0
- data/data/v5.1/abi/ERC2771CustomForwarder.json +1 -0
- data/data/v5.1/abi/IdentityRegistry.json +1 -0
- data/data/v5.1/abi/InterestPayment.json +1 -0
- data/data/v5.1/abi/PurchaseContract.json +1 -0
- data/data/v5.1/abi/RestrictedLockupToken.json +1 -0
- data/data/v5.1/abi/RestrictedLockupTokenExtension.json +1 -0
- data/data/v5.1/abi/RestrictedLockupTokenManagementExtension.json +1 -0
- data/data/v5.1/abi/RestrictedLockupTokenStandardsExtension.json +1 -0
- data/data/v5.1/abi/RestrictedSwap.json +1 -0
- data/data/v5.1/abi/SnapshotPeriods.json +1 -0
- data/data/v5.1/abi/TransferRules.json +1 -0
- data/data/v5.1/abi/merged/RestrictedLockupToken.json +1 -0
- data/data/v5.1/manifest.json +1 -0
- data/data/v5.1/verification-source-codes.json +1 -0
- data/lib/upsideos_evm_rwa_artifacts/version.rb +5 -0
- data/lib/upsideos_evm_rwa_artifacts.rb +118 -0
- metadata +81 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'json'
|
|
4
|
+
require 'pathname'
|
|
5
|
+
|
|
6
|
+
require_relative 'upsideos_evm_rwa_artifacts/version'
|
|
7
|
+
|
|
8
|
+
# ABIs and verification sources for audited EVM contract releases.
|
|
9
|
+
#
|
|
10
|
+
# The gem carries data only. It has no dependencies and runs no code at
|
|
11
|
+
# load time beyond reading the release directory.
|
|
12
|
+
module UpsideosEvmRwaArtifacts
|
|
13
|
+
RELEASES = %w[v5 v5.1 recallable-payment].freeze
|
|
14
|
+
|
|
15
|
+
class Error < StandardError; end
|
|
16
|
+
|
|
17
|
+
# The release name is not one this gem carries.
|
|
18
|
+
class UnknownRelease < Error; end
|
|
19
|
+
|
|
20
|
+
# The release carries no such file.
|
|
21
|
+
class UnknownFile < Error; end
|
|
22
|
+
|
|
23
|
+
DATA_ROOT = Pathname.new(File.expand_path('../data', __dir__)).freeze
|
|
24
|
+
|
|
25
|
+
CACHE = {}
|
|
26
|
+
CACHE_MUTEX = Mutex.new
|
|
27
|
+
private_constant :CACHE, :CACHE_MUTEX
|
|
28
|
+
|
|
29
|
+
class << self
|
|
30
|
+
def releases
|
|
31
|
+
RELEASES
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def release_dir(release)
|
|
35
|
+
name = release.to_s
|
|
36
|
+
unless RELEASES.include?(name)
|
|
37
|
+
raise UnknownRelease,
|
|
38
|
+
"Unknown release #{name}. Known: #{RELEASES.join(', ')}"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
DATA_ROOT.join(name)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Callers that hand a file to another tool, such as an explorer
|
|
45
|
+
# verification request, need the path rather than the content.
|
|
46
|
+
def path(release, file)
|
|
47
|
+
full = release_dir(release).join(file)
|
|
48
|
+
raise UnknownFile, "#{file} is not in release #{release}" unless full.file?
|
|
49
|
+
|
|
50
|
+
full
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def abi_path(release, contract)
|
|
54
|
+
path(release, "abi/#{contract}.json")
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# The token forwards unknown selectors into its extensions, so a caller
|
|
58
|
+
# that talks to the token address needs the merged call surface rather
|
|
59
|
+
# than the token ABI alone.
|
|
60
|
+
def merged_abi_path(release, contract)
|
|
61
|
+
path(release, "abi/merged/#{contract}.json")
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def verification_source_codes_path(release)
|
|
65
|
+
path(release, 'verification-source-codes.json')
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def manifest_path(release)
|
|
69
|
+
path(release, 'manifest.json')
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def abi(release, contract)
|
|
73
|
+
read_json(abi_path(release, contract))
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def merged_abi(release, contract)
|
|
77
|
+
read_json(merged_abi_path(release, contract))
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def verification_source_codes(release)
|
|
81
|
+
read_json(verification_source_codes_path(release))
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def manifest(release)
|
|
85
|
+
read_json(manifest_path(release))
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def contracts(release)
|
|
89
|
+
manifest(release).fetch('artifacts').map { |artifact| artifact.fetch('name') }
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def call_surfaces(release)
|
|
93
|
+
manifest(release).fetch('callSurfaces', []).map { |surface| surface.fetch('name') }
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def commit(release)
|
|
97
|
+
manifest(release).fetch('source').fetch('commit')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def compiler_version(release)
|
|
101
|
+
manifest(release).fetch('build').fetch('compilerLongVersion')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
private
|
|
105
|
+
|
|
106
|
+
# Parsed files are shared and frozen, because a release never changes
|
|
107
|
+
# once it is published.
|
|
108
|
+
def read_json(path)
|
|
109
|
+
key = path.to_s
|
|
110
|
+
cached = CACHE[key]
|
|
111
|
+
return cached unless cached.nil?
|
|
112
|
+
|
|
113
|
+
CACHE_MUTEX.synchronize do
|
|
114
|
+
CACHE[key] ||= JSON.parse(path.read).freeze
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: upsideos_evm_rwa_artifacts
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Upside
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: |-
|
|
13
|
+
Contract ABIs, merged call-surface ABIs, release manifests and solc
|
|
14
|
+
standard-json verification bundles for the audited EVM Security Token
|
|
15
|
+
releases. Data only, with no dependencies.
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- README.md
|
|
21
|
+
- data/recallable-payment/abi/AccessControl.json
|
|
22
|
+
- data/recallable-payment/abi/RecallablePayment.json
|
|
23
|
+
- data/recallable-payment/manifest.json
|
|
24
|
+
- data/recallable-payment/verification-source-codes.json
|
|
25
|
+
- data/v5.1/abi/AccessControl.json
|
|
26
|
+
- data/v5.1/abi/ERC2771CustomForwarder.json
|
|
27
|
+
- data/v5.1/abi/IdentityRegistry.json
|
|
28
|
+
- data/v5.1/abi/InterestPayment.json
|
|
29
|
+
- data/v5.1/abi/PurchaseContract.json
|
|
30
|
+
- data/v5.1/abi/RestrictedLockupToken.json
|
|
31
|
+
- data/v5.1/abi/RestrictedLockupTokenExtension.json
|
|
32
|
+
- data/v5.1/abi/RestrictedLockupTokenManagementExtension.json
|
|
33
|
+
- data/v5.1/abi/RestrictedLockupTokenStandardsExtension.json
|
|
34
|
+
- data/v5.1/abi/RestrictedSwap.json
|
|
35
|
+
- data/v5.1/abi/SnapshotPeriods.json
|
|
36
|
+
- data/v5.1/abi/TransferRules.json
|
|
37
|
+
- data/v5.1/abi/merged/RestrictedLockupToken.json
|
|
38
|
+
- data/v5.1/manifest.json
|
|
39
|
+
- data/v5.1/verification-source-codes.json
|
|
40
|
+
- data/v5/abi/AccessControl.json
|
|
41
|
+
- data/v5/abi/ERC2771CustomForwarder.json
|
|
42
|
+
- data/v5/abi/IdentityRegistry.json
|
|
43
|
+
- data/v5/abi/InterestPayment.json
|
|
44
|
+
- data/v5/abi/PurchaseContract.json
|
|
45
|
+
- data/v5/abi/RestrictedLockupToken.json
|
|
46
|
+
- data/v5/abi/RestrictedLockupTokenExtension.json
|
|
47
|
+
- data/v5/abi/RestrictedLockupTokenManagementExtension.json
|
|
48
|
+
- data/v5/abi/RestrictedSwap.json
|
|
49
|
+
- data/v5/abi/SnapshotPeriods.json
|
|
50
|
+
- data/v5/abi/TransferRules.json
|
|
51
|
+
- data/v5/abi/merged/RestrictedLockupToken.json
|
|
52
|
+
- data/v5/manifest.json
|
|
53
|
+
- data/v5/verification-source-codes.json
|
|
54
|
+
- lib/upsideos_evm_rwa_artifacts.rb
|
|
55
|
+
- lib/upsideos_evm_rwa_artifacts/version.rb
|
|
56
|
+
homepage: https://github.com/upsideos/contract-artifacts
|
|
57
|
+
licenses:
|
|
58
|
+
- MIT
|
|
59
|
+
metadata:
|
|
60
|
+
homepage_uri: https://github.com/upsideos/contract-artifacts
|
|
61
|
+
source_code_uri: https://github.com/upsideos/contract-artifacts/tree/main/packages/ruby
|
|
62
|
+
bug_tracker_uri: https://github.com/upsideos/contract-artifacts/issues
|
|
63
|
+
rubygems_mfa_required: 'true'
|
|
64
|
+
rdoc_options: []
|
|
65
|
+
require_paths:
|
|
66
|
+
- lib
|
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
|
+
requirements:
|
|
69
|
+
- - ">="
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: '3.1'
|
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
|
+
requirements:
|
|
74
|
+
- - ">="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
version: '0'
|
|
77
|
+
requirements: []
|
|
78
|
+
rubygems_version: 3.6.9
|
|
79
|
+
specification_version: 4
|
|
80
|
+
summary: ABIs and verification sources for audited EVM contract releases
|
|
81
|
+
test_files: []
|