-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
189 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
### | ||
# read all contract metadata | ||
|
||
|
||
class Meta | ||
def initialize( data ) | ||
@data = data | ||
## split and normalize names | ||
@names = (data['name'] || data['names']) | ||
.split( '|' ) | ||
.map { |name| name.gsub(/[ \t]+/, ' ' ).strip } | ||
end | ||
|
||
def name() @names[0]; end | ||
def names() @names; end | ||
|
||
def timestamp() @data['timestamp']; end | ||
def created() | ||
## use timestamp for now and ignore created for now - why? why not? | ||
Time.at( @data['timestamp'] ).utc | ||
end | ||
|
||
def address() @data['address']; end | ||
alias_method :addr, :address | ||
def txid() @data['txid']; end | ||
def creator() @data['creator']; end | ||
def block() @data['block']; end ## add blocknumber alias - why? why not? | ||
end # class Meta | ||
|
||
|
||
def each_contract( &block ) | ||
recs = read_meta | ||
recs.each do |rec| | ||
block.call( Meta.new( rec ) ) | ||
end | ||
end | ||
|
||
|
||
def read_meta( basedir='./address' ) | ||
puts "==> read contract metadata..." | ||
|
||
## collection all addresses | ||
recs = [] | ||
paths = Dir.glob( "#{basedir}/**/contract.yml" ) | ||
## paths = paths[0..2] | ||
paths.each do |path| | ||
data = read_yaml( path ) | ||
|
||
## auto-add basedir or such - why? why not? | ||
|
||
## auto-add addr or dobule check - why? why not? | ||
## basename = File.basename( File.dirname( path )) | ||
|
||
recs << data | ||
end | ||
|
||
############ | ||
## sort by block (reverse chronological) | ||
recs = recs.sort do |l,r| | ||
l['block'] <=> r['block'] | ||
end | ||
|
||
## pp recs | ||
## puts " #{recs.size} record(s)" | ||
|
||
recs | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
# Notes About Solidity | ||
|
||
|
||
## Todos | ||
|
||
fix moonbirds scan | ||
|
||
``` | ||
interface ITokenURIGenerator | ||
contract Moonbirds is ERC721ACommon, BaseTokenURI, FixedPriceSeller, SignerManager, ERC2981, AccessControlEnumerable | ||
contract) external onlyOwner | ||
contract; } /** @notice If renderingContract is set then returns its tokenURI(tokenId) return value, otherwise returns the standard baseTokenURI + tokenId. */ function tokenURI(uint256 tokenId) public view override returns (string memory) | ||
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata | ||
``` | ||
|
||
|
||
|
||
## More | ||
|
||
Solidity by Example - | ||
|
||
Solidity in x Minutes - | ||
|
||
Awesome Solidity - <https://github.com/bkrem/awesome-solidity> | ||
|