-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor/sqrt_price_math
- Loading branch information
Showing
53 changed files
with
2,943 additions
and
1,306 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: tlin-check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tlin-check: | ||
strategy: | ||
fail-fast: false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: checkout tlin | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: gnoverse/tlin | ||
ref: main | ||
path: ./tlin | ||
|
||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: changed files | ||
id: changed_files | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
files: | | ||
*.gno | ||
**.gno | ||
- name: install tlin | ||
run: | | ||
cd tlin | ||
go install ./cmd/tlin | ||
- name: tlin check | ||
run: | | ||
for file in ${{ steps.changed_files.outputs.all_changed_files }}; do | ||
echo "checking ${file} ..." | ||
tlin ${file} | ||
done |
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,53 @@ | ||
loadpkg gno.land/p/demo/users | ||
|
||
loadpkg gno.land/r/demo/foo20 | ||
loadpkg gno.land/r/demo/grc20reg | ||
|
||
loadpkg gno.land/r/demo/reg $WORK/reg | ||
|
||
## start a new node | ||
gnoland start | ||
|
||
## faucet | ||
# gnokey maketx call -pkgpath gno.land/r/demo/foo20 -func Faucet -gas-fee 1ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1 | ||
|
||
## print reg addr | ||
gnokey maketx call -pkgpath gno.land/r/demo/reg -func RelamAddr -gas-fee 1ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1 | ||
stdout 'g19tlskvga928es8ug2empargp0teul03apzjud9' | ||
|
||
## approve | ||
gnokey maketx call -pkgpath gno.land/r/demo/foo20 -func Approve -args 'g19tlskvga928es8ug2empargp0teul03apzjud9' -args '100' -gas-fee 1ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1 | ||
|
||
## transfer from | ||
gnokey maketx call -pkgpath gno.land/r/demo/reg -func TransferFromWithReg -gas-fee 1ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1 | ||
stdout '' | ||
|
||
-- reg/reg.gno -- | ||
package reg | ||
|
||
import ( | ||
"std" | ||
|
||
"gno.land/r/demo/grc20reg" | ||
) | ||
|
||
func RelamAddr() string { | ||
addr := std.CurrentRealm().Addr().String() | ||
return addr | ||
} | ||
|
||
func TransferFromWithReg() { | ||
caller := std.PrevRealm().Addr() | ||
curr := std.CurrentRealm().Addr() | ||
|
||
|
||
// using import | ||
// foo20.TransferFrom(uCaller, uCurr, uint64(100)) | ||
|
||
// using grc20reg | ||
fooTokenGetter := grc20reg.Get("gno.land/r/demo/foo20") | ||
fooToken := fooTokenGetter() | ||
userTeller := fooToken.CallerTeller() | ||
|
||
userTeller.TransferFrom(caller, curr, uint64(100)) | ||
} |
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
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
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
Oops, something went wrong.